NAME

Path::Resolver::Resolver::Mux::Ordered - multiplex resolvers by checking them in order

VERSION

version 3.100455

SYNOPSIS

  my $resolver = Path::Resolver::Resolver::Mux::Ordered->new({
    resolvers => [
      $resolver_1,
      $resolver_2,
      ...
    ],
  });

  my $simple_entity = $resolver->entity_at('foo/bar.txt');

This resolver looks in each of its resolvers in order and returns the result of the first of its sub-resolvers to find the named entity. If no entity is found, it returns false as usual.

The default native type of this resolver is Any, meaning that is is much more lax than other resolvers. A native_type can be specified while creating the resolver.

PERL VERSION

This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years.

Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl.

ATTRIBUTES

resolvers

This is an array of other resolvers. When asked for content, the Mux::Ordered resolver will check each resolver in this array and return the first found content, or false if none finds any content.

METHODS

unshift_resolver

This method will add a resolver to the beginning of the list of consulted resolvers.

push_resolver

This method will add a resolver to the end of the list of consulted resolvers.

AUTHOR

Ricardo Signes <cpan@semiotic.systems>

COPYRIGHT AND LICENSE

This software is copyright (c) 2022 by Ricardo Signes.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.