Skip to content

Commit 244abca

Browse files
committed
Working on signal
This refs #3844 Also, totally unrelated (although they are functionally related, working on improving Scheduler #refs 3845"
1 parent 8c6159f commit 244abca

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

doc/Type/Lock.pod6

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,16 @@ L<https://en.wikipedia.org/wiki/Monitor_%28synchronization%29> for background.
170170
my $l = Lock.new;
171171
$l.condition;
172172
173+
=head2 method signal
174+
175+
Defined as:
176+
177+
method signal()
178+
179+
If and only if there are any threads that have previously waited on the
180+
condition variable, it unblocks at least one of them.
181+
182+
173183
=end pod
174184

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

doc/Type/Scheduler.pod6

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
Common role for schedulers. A scheduler is a piece of code that determines
1212
which resources to use to run which task, and when.
1313
14-
Some operations for example on L<Proc::Async|/type/Proc::Async>, L<Promise|/type/Promise>,
15-
L<Supply|/type/Supply> allow you to specify a scheduler explicitly; they
16-
generally expect those schedulers to follow the interface defined by
17-
C<Scheduler>
14+
Some operations for example on L<Proc::Async|/type/Proc::Async>,
15+
L<Promise|/type/Promise>, L<Supply|/type/Supply> allow you to specify a
16+
scheduler explicitly; they generally expect those schedulers to follow the
17+
interface defined by C<Scheduler>.
1818
1919
=head1 Methods
2020
@@ -30,28 +30,31 @@ code that is being scheduled and run.
3030
method cue(&code, Instant :$at, :$in, :$every, :$times = 1; :&catch --> Cancellation)
3131
3232
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:
33+
L<C<Cancellation>|/type/Cancellation> object to cancel the scheduling of the
34+
code for execution (which is especially important if you specify the C<:every
35+
( time )> named parameter). The adverbs control when and how the code is run:
3636
37-
C<$at> can be an L<Instant|/type/Instant> before which the code won't be run.
37+
=item C<$at> can be an L<Instant|/type/Instant> before which the code won't be
38+
run.
3839
Alternatively C<$in> is the number of seconds (possibly fractional) to wait
3940
before running the code. If C<$at> is in the past or C<$in> is negative,
4041
the delay is treated as zero. Implementations may equate to zero
4142
very small values (e.g. lower than 0.001s) of C<$in> or result of
4243
C<$at> - L<now|/routine/now>.
4344
44-
If C<$every> is specified, it is interpreted as the number of seconds
45+
=item If C<$every> is specified, it is interpreted as the number of seconds
4546
(possibly fractional) to wait before re-executing the code. Implementations
4647
may treat too-small values as lowest resolution they support, possibly
4748
warning in such situations; e.g. treating C<0.0001> as C<0.001>.
4849
49-
C<$times> tells the scheduler how many times to run the code.
50+
=item C<$times> tells the scheduler how many times to run the code.
5051
51-
C<&catch> is called with the L<Exception|/type/Exception> as its sole argument
52+
=item C<&catch> is called with the L<Exception|/type/Exception> as its sole
53+
argument
5254
if C<&code> dies.
5355
54-
If C<$at> or C<$in> are C<Inf>, C<&code> will never be run; if C<$every> is
56+
=item If C<$at> or C<$in> are C<Inf>, C<&code> will never be run; if
57+
C<$every> is
5558
C<Inf>, C<&code> will only be run once. If any of the three are C<-Inf>,
5659
C<&code> will be run immediately. If any of the three are C<NaN>, an
5760
L<X::Scheduler::CueInNaNSeconds|/type/X::Scheduler::CueInNaNSeconds> exception

0 commit comments

Comments
 (0)