Skip to content

Commit 2c06edd

Browse files
committed
Document await(Promise) and await(Channel)
1 parent deb7189 commit 2c06edd

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

lib/Type/Channel.pod

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,13 @@ Closes the channel (that is, makes subsequent C<send> calls die), and enqueues
8686
the error as the final element in the channel. Method C<receive> will throw
8787
the error as an exception.
8888
89+
=head2 sub await
90+
91+
multi sub await(Channel:D)
92+
multi sub await(*@)
93+
94+
Waits until all of one or more channels has a value available, and returns
95+
those values (it calls C<.receive> on the channel). Also works with
96+
L<promises|/type/Promise>.
97+
8998
=end pod

lib/Type/Promise.pod

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,4 +211,12 @@ exception of type C<X::Promise::Vowed>.
211211
$vow.keep;
212212
say $p.status; # Kept
213213
214+
=head2 sub await
215+
216+
multi sub await(Promise:D)
217+
multi sub await(*@)
218+
219+
Waits until one or more promises are all fulfilled, and then returns their
220+
values. Also works on L<channels|/type/Channel>.
221+
214222
=end pod

0 commit comments

Comments
 (0)