-
-
Save jonathanstowe/925f4a89988b384625dfa42e79334343 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 $supplier = Supplier.new; | |
start { | |
loop { | |
for ( 33 ... 126 ).map( { Buf.new($_) }) -> $c { | |
$supplier.emit($c); | |
} | |
} | |
} | |
react { | |
whenever IO::Socket::Async.listen('localhost', 3333) -> $conn { | |
whenever $supplier -> $v { | |
$conn.write: $v; | |
} | |
} | |
} | |
say "done"; |
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
use v6.c; | |
my $supplier = Supplier.new; | |
start { | |
CATCH { | |
default { | |
say "HSSHS $_"; | |
} | |
} | |
loop { | |
for ( 33 ... 126 ).map( { Buf.new($_) }) -> $c { | |
$supplier.emit($c); | |
} | |
} | |
} | |
react { | |
CATCH { | |
default { | |
say "REACT $_"; | |
} | |
} | |
whenever IO::Socket::Async.listen('localhost', 3333) -> $conn { | |
CATCH { | |
default { | |
say "SOCKET $_"; | |
} | |
} | |
my $p = True; | |
whenever signal(SIGPIPE) { | |
CATCH { | |
default { | |
say "signal $_"; | |
} | |
} | |
$p = False; | |
} | |
whenever $supplier -> $v { | |
CATCH { | |
default { | |
say "ggg : $_"; | |
$p = False; | |
} | |
} | |
if $p { | |
await $conn.write: $v; | |
} | |
}; | |
} | |
} | |
# vim: expandtab shiftwidth=4 ft=perl6 |
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
ggg : broken pipe | |
ggg : broken pipe | |
Unhandled exception in code scheduled on thread 9 | |
Cannot resolve caller postcircumfix:<[ ]>(Mu, Int); none of these signatures match: | |
(\SELF, Any:U $type, |c is raw) | |
(\SELF, int $pos) | |
(\SELF, int $pos, Mu \assignee) | |
(\SELF, int $pos, Mu :$BIND! is raw) | |
(\SELF, int $pos, :$delete!, *%other) | |
(\SELF, int $pos, :$exists!, *%other) | |
(\SELF, int $pos, :$kv!, *%other) | |
(\SELF, int $pos, :$p!, *%other) | |
(\SELF, int $pos, :$k!, *%other) | |
(\SELF, int $pos, :$v!, *%other) | |
(\SELF, Int:D $pos) | |
(\SELF, Int:D $pos, Mu \assignee) | |
(\SELF, Int:D $pos, Mu :$BIND! is raw) | |
(\SELF, Int:D $pos, :$delete!, *%other) | |
(\SELF, Int:D $pos, :$exists!, *%other) | |
(\SELF, Int:D $pos, :$kv!, *%other) | |
(\SELF, Int:D $pos, :$p!, *%other) | |
(\SELF, Int:D $pos, :$k!, *%other) | |
(\SELF, Int:D $pos, :$v!, *%other) | |
(\SELF, Any:D \pos) | |
(\SELF, Any:D \pos, Mu \assignee) | |
(\SELF, Any:D \pos, Mu :$BIND! is raw) | |
(\SELF, Any:D \pos, :$delete!, *%other) | |
(\SELF, Any:D \pos, :$exists!, *%other) | |
(\SELF, Any:D \pos, :$kv!, *%other) | |
(\SELF, Any:D \pos, :$p!, *%other) | |
(\SELF, Any:D \pos, :$k!, *%other) | |
(\SELF, Any:D \pos, :$v!, *%other) | |
(\SELF, Iterable:D \pos) | |
(\SELF, Iterable:D \pos, Mu \val) | |
(\SELF, Iterable:D \pos, :$BIND!) | |
(\SELF, Iterable:D \pos, :$delete!, *%other) | |
(\SELF, Iterable:D \pos, :$exists!, *%other) | |
(\SELF, Iterable:D \pos, :$kv!, *%other) | |
(\SELF, Iterable:D \pos, :$p!, *%other) | |
(\SELF, Iterable:D \pos, :$k!, *%other) | |
(\SELF, Iterable:D \pos, :$v!, *%other) | |
(\SELF, Callable:D $block) | |
(\SELF, Callable:D $block, Mu \assignee) | |
(\SELF, Callable:D $block, :$BIND!) | |
(\SELF, Callable:D $block, :$delete!, *%other) | |
(\SELF, Callable:D $block, :$exists!, *%other) | |
(\SELF, Callable:D $block, :$kv!, *%other) | |
(\SELF, Callable:D $block, :$p!, *%other) | |
(\SELF, Callable:D $block, :$k!, *%other) | |
(\SELF, Callable:D $block, :$v!, *%other) | |
(\SELF, Whatever:D) | |
(\SELF, Whatever:D, Mu \assignee) | |
(\SELF, Whatever:D, :$BIND!) | |
(\SELF, Whatever:D, :$delete!, *%other) | |
(\SELF, Whatever:D, :$exists!, *%other) | |
(\SELF, Whatever:D, :$kv!, *%other) | |
(\SELF, Whatever:D, :$p!, *%other) | |
(\SELF, Whatever:D, :$k!, *%other) | |
(\SELF, Whatever:D, :$v!, *%other) | |
(\SELF, HyperWhatever:D, *%adv) | |
(\SELF, HyperWhatever:D, Mu \assignee) | |
(\SELF, :$BIND!) | |
(\SELF, :$delete!, *%other) | |
(\SELF, :$exists!, *%other) | |
(\SELF, :$kv!, *%other) | |
(\SELF, :$p!, *%other) | |
(\SELF, :$k!, *%other) | |
(\SELF, :$v!, *%other) | |
(\SELF, *%other) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment