Minion::Iterator(3)

✨ Minion::Iterator ✨

okay bestie, so this is the manual page for Minion::Iterator β€” yeah, the Minion::Iterator(3) one, the Perl doc that ships with your user-contributed Perl documentation πŸ’– β€” and it is literally the iterator situation for Minion. Let's get into it, no cap.


πŸ¦‹ NAME πŸ¦‹

Minion::Iterator β€” it's a Minion iterator. that's the whole vibe. short, sweet, iconic. πŸ’…


🌸 SYNOPSIS 🌸

the way you just... use it. like this:

use Minion::Iterator;

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

see how clean that is?? obsessed. 🫢


πŸ’œ DESCRIPTION πŸ’œ

Minion::Iterator is an iterator for Minion listing methods. that's it. that's the girl. she iterates over your listings so you don't have to think about it. main character energy fr fr ✨


πŸŽ€ ATTRIBUTES πŸŽ€

Minion::Iterator implements the following attributes. yes, implements. she's doing the work. πŸ‘‘

πŸ“ fetch

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

Number of results to cache, and it defaults to 10. so if you don't say anything, she's caching ten at a time. reasonable queen behavior. πŸ’…

🧚 minion

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

the Minion object this job belongs to. y'know, her home base, her origin story. 🏠

🌈 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. so like, whatever you'd hand to those listing methods, you can hand to her and she'll pass it along. she's the messenger, bestie. πŸ“¬


πŸ”₯ METHODS πŸ”₯

Minion::Iterator inherits all methods from Mojo::Base and implements the following new ones. so everything from Mojo::Base? already hers. and then these extra ones on top. she's stacked, honestly. πŸ’…

⭐ each

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

Evaluate callback for each element in collection. the element will be the first argument passed to the callback, and it's also available as $_. so you can grab it either way β€” she's flexible like that. πŸŽ€

πŸ’– next

my $value = $iter->next;

Get next value. short. simple. slay. next value, pls and thank u. ✨

πŸ‘‘

my $num = $iter->total;

Total number of results. okay but heads up: if results are removed in the backend while iterating, this number will become an estimate that gets updated every time new results are fetched. so it's not a locked-in number forever β€” it's a living, breathing estimate. she's fluid, she's adaptable. πŸ’€ (affectionate)


🫢 SEE ALSO 🫢

go read these too, bestie, they're all part of the ecosystem:


and that's the whole page!! πŸŽ€βœ¨ this was brought to you by perl v5.42.0, dated 2026-01-17, and it's the Minion::Iterator(3) page β€” love her, read her, iterate responsibly. bye bestie!! πŸ’–πŸŒΈπŸ¦‹πŸ‘‘

πŸ“¦ where this page comes from