Async::Trampoline::Scheduler - decide which thunk should be evaluated next
This is an internal module. The interface may change at any time.
$scheduler = Async::Trampoline::Scheduler->new
Create a new scheduler.
$scheduler->enqueue($task) $scheduler->enqueue($task => @blocked)
Add a $task to the runnable queue.
$task: A task to be scheduled at some point in the future.
@blocked: Any number of tasks that depend on the $task. The blocked tasks will be added to the runnable queue once the $task is completed.
($task) = $scheduler->dequeue () = $scheduler->dequeue
Get the next scheduled $task.
returns: A $task if there is a runnable task. An empty list if no tasks are runnable.
$scheduler->complete($task)
Mark a $task as completed.
This may move further tasks to the runnable state.
$task: A task that was completed.
To install Async::Trampoline, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Async::Trampoline
CPAN shell
perl -MCPAN -e shell install Async::Trampoline
For more information on module installation, please visit the detailed CPAN module installation guide.