File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -466,6 +466,19 @@ This is such a common pattern that we make a channel in list context behave that
466
466
(Note that this is not a combinator, but a means for transfering data from the reactive
467
467
realm to the lazy realm. Some reasonable amount of buffering is assumed between the two.)
468
468
469
+ We didn't have to use C<*> above; instead we could have said:
470
+
471
+ gather loop {
472
+ winner $c {
473
+ more $c { take $_ }
474
+ done $c { last }
475
+ }
476
+ }
477
+
478
+ This works because C<more> only ever works on channels, while C<done>
479
+ only ever works on promises, so it knows to check the promise of
480
+ channel C<$c> rather than C<$c> itself.
481
+
469
482
=head2 Supplies
470
483
471
484
Channels are good for producer/consumer scenarios, but because each worker
You can’t perform that action at this time.
0 commit comments