Skip to content

Instantly share code, notes, and snippets.

@AlexDaniel
Created August 16, 2019 23: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 AlexDaniel/f21b0161dfb205224bff45234ca374e9 to your computer and use it in GitHub Desktop.
Save AlexDaniel/f21b0161dfb205224bff45234ca374e9 to your computer and use it in GitHub Desktop.
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