Skip to content

Commit 9090b1d

Browse files
committed
Document Supply.batch(:emit-timed)
lizmat++ Closes #4618
1 parent c537c5a commit 9090b1d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

doc/Type/Supply.rakudoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,13 +372,17 @@ C<&mapper> and emits it to the new supply.
372372

373373
=head2 method batch
374374

375-
method batch(Supply:D: :$elems, :$seconds --> Supply:D)
375+
method batch(Supply:D: :$elems, :$seconds, :$emit-timed --> Supply:D)
376376

377377
Creates a new supply that batches the values of the given supply by either
378378
the number of elements in the batch (using C<:elems>) or a duration
379379
(using C<:seconds>) or both. Any remaining values are emitted in
380380
a final batch when the supply is done.
381381

382+
When C<:emit-timed> is specified, a timer will run, emitting
383+
whatever is in the batch every given number of C<:seconds>, if the
384+
batch contains any values.
385+
382386
B<Note>: Since Rakudo release 2020.12, the C<:seconds> parameter has
383387
a millisecond granularity: for example a 1 millisecond duration could
384388
be specified as C<:seconds(0.001)>. Before Rakudo release 2020.12,

0 commit comments

Comments
 (0)