Skip to content

Commit

Permalink
Mention Cancellation object returned by .cue
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Oct 29, 2014
1 parent b4aedd1 commit dcada73
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions S17-concurrency.pod
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,13 @@ You can do this with the C<:stop> parameter.
sleep 10;
$stop = True; # task stopped after 10 seconds

The C<.cue> method returns a C<Cancellation> object, which can also be used
to stop a repeating cue:

my $c = $*SCHEDULER.cue: :every(1), { say "Oh wow, a kangaroo!" };
sleep 10;
$c.cancel; # task stopped after 10 seconds

Schedulers also provide counts of the number of operations in various states:

say $*SCHEDULER.loads;
Expand Down

0 comments on commit dcada73

Please sign in to comment.