logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Minion::Iterator - Minion iterator

Attributes

       Minion::Iterator implements the following attributes.

   fetch
         my $fetch = $iter->fetch;
         $iter     = $iter->fetch(2);

       Number of results to cache, defaults to 10.

   minion
         my $minion = $iter->minion;
         $iter      = $iter->minion(Minion->new);

       Minion object this job belongs to.

   options
         my $options = $iter->options;
         $iter       = $iter->options({states => ['inactive']});

       Options to be passed to "list_jobs" in Minion::Backend or "list_workers" in Minion::Backend.

Description

       Minion::Iterator is an iterator for Minion listing methods.

Methods

       Minion::Iterator inherits all methods from Mojo::Base and implements the following new ones.

   each
         $iter->each(sub {...});

       Evaluate callback for each element in collection. The element will be the first argument passed to the
       callback, and is also available as $_.

   next
         my $value = $iter->next;

       Get next value.

   total
         my $num = $iter->total;

       Total number of results. If results are removed in the backend while iterating, this number will become
       an estimate that gets updated every time new results are fetched.

Name

       Minion::Iterator - Minion iterator

See Also

       Minion, Minion::Guide, <https://minion.pm>, Mojolicious::Guides, <https://mojolicious.org>.

perl v5.40.0                                       2024-12-20                              Minion::Iterator(3pm)

Synopsis

         use Minion::Iterator;

         my $iter = Minion::Iterator->new(minion  => $minion, options => {states => ['inactive']});

See Also