Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Document await(Promise) and await(Channel)
  • Loading branch information
moritz committed Feb 7, 2015
1 parent deb7189 commit 2c06edd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/Type/Channel.pod
Expand Up @@ -86,4 +86,13 @@ Closes the channel (that is, makes subsequent C<send> calls die), and enqueues
the error as the final element in the channel. Method C<receive> will throw
the error as an exception.
=head2 sub await
multi sub await(Channel:D)
multi sub await(*@)
Waits until all of one or more channels has a value available, and returns
those values (it calls C<.receive> on the channel). Also works with
L<promises|/type/Promise>.
=end pod
8 changes: 8 additions & 0 deletions lib/Type/Promise.pod
Expand Up @@ -211,4 +211,12 @@ exception of type C<X::Promise::Vowed>.
$vow.keep;
say $p.status; # Kept
=head2 sub await
multi sub await(Promise:D)
multi sub await(*@)
Waits until one or more promises are all fulfilled, and then returns their
values. Also works on L<channels|/type/Channel>.
=end pod

0 comments on commit 2c06edd

Please sign in to comment.