Last active
October 13, 2017 18:15
-
-
Save ugexe/ee12646ef6ee1302a54a30cf85b3639b 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
RAKUDO_SCHEDULER_DEBUG=1 perl6-gdb-m --ll-exception -e 'while 1 { use v6.d.PREVIEW; my %c = (:0reactor_count); my $s = supply { whenever IO::Socket::Async.listen("0.0.0.0", 5000) -> $c-conn { %c{$c-conn}<bar>++; emit $c-conn; %c{$c-conn}<msgs-supplier> = Supplier.new; $c-conn.Supply.lines.tap({ %c{$c-conn}<msgs-supplier>.emit: $_ }); } }; sub start_reactor ($msgs-in) { start { react whenever $msgs-in -> $msg-in { say "before"; say QX("echo foo"); say "after"; %c<reactor_count>++; } } }; start { react whenever $s -> $c-conn { start { start_reactor(%c{$c-conn}<msgs-supplier>.Supply); } } }; sleep 1; my $c = await IO::Socket::Async.connect("0.0.0.0", 5000); await $c.print("foo\n"); sleep 1; }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment