Help language development. Donate to The Perl Foundation

Scheduler::DelayBetween cpan:ATROXAPER last updated on 2019-04-27

Scheduler-DelayBetween-1.3.1/

Build Status

NAME

Scheduler::DelayBetween - Standard Scheduler cue sub with possibility to set a delay between each code execution.

SYNOPSIS

use Scheduler::DelayBetween;

my $cancel = cue({ say 'boom'; sleep 3; }, :1delay-between, :5in);
sleep 60;
# got boom 14 times
$cancel.cancel;

DESCRIPTION

Sometimes you may need to execute some code several times with fixed delay between each execution. Standard Scheduler method cue do not provide such possibility. You can achieve it with this module.

It provides a single subroutine:

cue(&code, :$at, :$in, :$every, :$times = 0, :&stop, :&catch, :$delay-between, :$scheduler = $*SCHEDULER --> Cancellation)

Parameters meaning:

The subroutine will return a Cancellation object you can use to cancel the future code run.

AUTHOR

Mikhail Khorkov atroxaper@cpan.org

Source can be located at: GitHub. Comments and Pull Requests are welcome.

COPYRIGHT AND LICENSE

Copyright 2019 Mikhail Khorkov

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.