AnyEvent::Retry::Interval::Multi - combine multiple interval objects into one interval
version 0.03
my $m = AnyEvent::Retry::Interval::Multi->new( first => { Constant => { interval => .5 } }, after => -2, then => { Multi => { first => 'Fibonacci', after => 10, then => { Multi => { first => { Constant => { interval => 10 } }, after => -6, then => { Constant => { interval => 60 } }, }}, }}, );
$m waits for .5 seconds twice, then it waits for 1 second, 1 second, 2 seconds, 3 seconds, 5 seconds, 8 seconds, then 10 seconds 6 times, then 60 seconds forever.
$m
See the code and tests for more detail.
Jonathan Rockway <jrockway@cpan.org>
This software is copyright (c) 2010 by Jonathan Rockway.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install AnyEvent::Retry, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AnyEvent::Retry
CPAN shell
perl -MCPAN -e shell install AnyEvent::Retry
For more information on module installation, please visit the detailed CPAN module installation guide.