-
-
Save AlexDaniel/f21b0161dfb205224bff45234ca374e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $channel = Channel.new(); | |
sub a { | |
b(); | |
gather loop { | |
take $channel.poll() // do { | |
b(); | |
$channel.receive(); | |
} | |
} | |
} | |
sub b() { | |
$channel.send(3); | |
$channel.send(4); | |
} | |
for a() -> $a { | |
say $a; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment