1Minion::Iterator(3)   User Contributed Perl Documentation  Minion::Iterator(3)
2
3
4

NAME

6       Minion::Iterator - Minion iterator
7

SYNOPSIS

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

DESCRIPTION

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

ATTRIBUTES

17       Minion::Iterator implements the following attributes.
18
19   fetch
20         my $fetch = $iter->fetch;
21         $iter     = $iter->fetch(2);
22
23       Number of results to cache, defaults to 10.
24
25   minion
26         my $minion = $iter->minion;
27         $iter      = $iter->minion(Minion->new);
28
29       Minion object this job belongs to.
30
31   options
32         my $options = $iter->options;
33         $iter       = $iter->options({states => ['inactive']});
34
35       Options to be passed to "list_jobs" in Minion::Backend or
36       "list_workers" in Minion::Backend.
37

METHODS

39       Minion::Iterator inherits all methods from Mojo::Base and implements
40       the following new ones.
41
42   each
43         $iter->each(sub {...});
44
45       Evaluate callback for each element in collection. The element will be
46       the first argument passed to the callback, and is also available as $_.
47
48   next
49         my $value = $iter->next;
50
51       Get next value.
52
53   total
54         my $num = $iter->total;
55
56       Total number of results. If results are removed in the backend while
57       iterating, this number will become an estimate that gets updated every
58       time new results are fetched.
59

SEE ALSO

61       Minion, Minion::Guide, <https://minion.pm>, Mojolicious::Guides,
62       <https://mojolicious.org>.
63
64
65
66perl v5.34.0                      2021-07-22               Minion::Iterator(3)
Impressum