Skip to content

Commit 699d350

Browse files
committed
Mention the cancellation feature of ThreadPoolScheduler.cue
1 parent ea18753 commit 699d350

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

doc/Type/Scheduler.pod6

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ code that is being scheduled and run.
2727
2828
=head2 method cue
2929
30-
method cue(&code, Instant :$at, :$in, :$every, :$times = 1; :&catch)
30+
method cue(&code, Instant :$at, :$in, :$every, :$times = 1; :&catch -> $cancelation)
3131
32-
Schedules a callable (C<&code>) for execution. The adverbs control when and
33-
how the code is run:
32+
Schedules a callable (C<&code>) for execution and returns an instantiated
33+
C<Cancellation> object to cancel the scheduling of the code for execution
34+
(which is especially important if you specify the C<every => time> named
35+
parameter. The adverbs control when and how the code is run:
3436
3537
C<$at> can be an L<Instant|/type/Instant> before which the code won't be run.
3638
Alternatively C<$in> is the number of seconds (possibly fractional) to wait
@@ -49,6 +51,9 @@ C<$times> tells the scheduler how many times to run the code.
4951
C<&catch> is called with the L<Exception|/type/Exception> as its sole argument
5052
if C<&code> dies.
5153
54+
One should call the C<cancel> method on the returned C<Cancellation> object
55+
to cancel the (possibly repeated) cueing of the code.
56+
5257
=end pod
5358

5459
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)