-
-
28 Apr 2022 15:19:54 UTC
- Distribution: Minion
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (287 / 0 / 9)
- Kwalitee
Bus factor: 2- 26.91% Coverage
- License: artistic_2
- Perl: v5.16.0
- Activity
24 month- Tools
- Download (1.62MB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
Minion::Iterator - Minion iterator
SYNOPSIS
use Minion::Iterator; my $iter = Minion::Iterator->new(minion => $minion, options => {states => ['inactive']});
DESCRIPTION
Minion::Iterator is an iterator for Minion listing methods.
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.
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.
SEE ALSO
Minion, Minion::Guide, https://minion.pm, Mojolicious::Guides, https://mojolicious.org.
Module Install Instructions
To install Minion, copy and paste the appropriate command in to your terminal.
cpanm Minion
perl -MCPAN -e shell install Minion
For more information on module installation, please visit the detailed CPAN module installation guide.