We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f693ca4 + dacf38f commit 976fa40Copy full SHA for 976fa40
doc/Type/Supply.pod
@@ -148,18 +148,16 @@ the GUI thread.
148
Waits until the supply is done (in which case it returns C<True>) or C<quit>
149
(in which case it will throw the exception that was passed to C<quit>).
150
151
- my $s = Supply.new;
152
- $s.tap(&say);
153
- my $p = Promise.allof((^10).pick(*).map: -> $v {
154
- start {
155
- $s.emit($v)
156
- }
157
- });
158
- $p.then({ $s.done });
159
-
160
- $s.wait;
161
- say "Done";
162
- await $p;
+ my $s = Supplier.new;
+ start {
+ sleep 1;
+ say "One second: running.";
+ $s.emit(42);
+ $s.done;
+ }
+ $s.Supply.wait;
+ say "Two seconds: done";
163
164
=head2 method list
165
0 commit comments