Skip to content

Instantly share code, notes, and snippets.

@jnthn

jnthn/shorter.p6 Secret

Created December 7, 2016 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnthn/ad63b599d6017a7ee82f415e1fd4d86f to your computer and use it in GitHub Desktop.
Save jnthn/ad63b599d6017a7ee82f415e1fd4d86f to your computer and use it in GitHub Desktop.
my $channel = Channel.new;
react {
for (^10).pick(*).map( -> $i { Promise.in($i + 0.5).then({ $i })}) -> $p {
whenever $p -> $v {
$channel.send: $v;
}
}
CLOSE {
$channel.close;
}
}
say $channel.list;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment