-
-
Save cxreg/62f04e703c90f34b418a 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
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