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   next
43         my $value = $iter->next;
44
45       Get next value.
46
47   total
48         my $num = $iter->total;
49
50       Total number of results. If results are removed in the backend while
51       iterating, this number will become an estimate that gets updated every
52       time new results are fetched.
53

SEE ALSO

55       Minion, <https://minion.pm>, Mojolicious::Guides,
56       <https://mojolicious.org>.
57
58
59
60perl v5.32.0                      2020-08-02               Minion::Iterator(3)
Impressum