Skip to content

Instantly share code, notes, and snippets.

@cxreg
Created January 4, 2016 07:22
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 cxreg/62f04e703c90f34b418a to your computer and use it in GitHub Desktop.
Save cxreg/62f04e703c90f34b418a to your computer and use it in GitHub Desktop.
sub handle($inputchannel, $outputchannel) {
say [$inputchannel, $outputchannel];
}
my $channels = [];
loop (my $i = 0 ; $i <= 10; $i++) {
$channels.append(Channel.new);
}
loop ($i = 2 ; $i <= 10; $i++) {
start handle($channels[$i-1], $channels[$i]);
}
sleep 1;
output:
count@bumba:~$ perl6 start-wtf.pl6
[Channel.new (Any)]
[Channel.new Channel.new]
[Channel.new Channel.new]
[Channel.new Channel.new]
[Channel.new Channel.new]
[Channel.new (Any)]
[Channel.new Channel.new]
[Channel.new Channel.new]
[Channel.new Channel.new]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment