Skip to content

Commit 32145ab

Browse files
committed
Add warning about gather/take react/whenever
nine++ Closes #4041
1 parent 0d3ee3c commit 32145ab

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

doc/Language/control.pod6

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,11 @@ makes it a hash.
759759
my %h = gather { take "foo" => 1; take "bar" => 2};
760760
say %h; # OUTPUT: «{bar => 2, foo => 1}␤»
761761
762+
B<Note>: C<gather/take> must not be used to collect results from C<react/whenever>.
763+
The C<whenever> block is not run from the thread that runs the C<gather/react>, but
764+
the thread that runs the C<emit>. On this thread, there is no handler for the
765+
control exception thrown by C<take>, causing it to error out.
766+
762767
=head1 X<supply/emit|Control flow,supply emit>
763768
764769
Emits the invocant into the enclosing

0 commit comments

Comments
 (0)