Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
&await works best with defined promises and channels
  • Loading branch information
moritz committed Feb 7, 2015
1 parent 3f9508c commit a4ceed6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/asyncops.pm
Expand Up @@ -4,13 +4,13 @@
# pool that blocks; for now, this cheat gets the basic idea in place.

proto sub await(|) { * }
multi sub await(Promise $p) {
multi sub await(Promise:D $p) {
$p.result
}
multi sub await(*@awaitables) {
@awaitables.eager.map(&await)
}
multi sub await(Channel $c) {
multi sub await(Channel:D $c) {
$c.receive
}

Expand Down

0 comments on commit a4ceed6

Please sign in to comment.