Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created June 13, 2019 22:31
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 Whateverable/5ab3f9f26123c0738684a90863e31805 to your computer and use it in GitHub Desktop.
Save Whateverable/5ab3f9f26123c0738684a90863e31805 to your computer and use it in GitHub Desktop.
evalable6
my Supplier::Preserving $msg .= new; my $senser = supply { whenever $msg { emit $_; QUIT { say "the thing quit oh no" } }; }; start { react { whenever $senser { .say; if (False, False, False, True).pick { say "cannot write to closed socket"; die "oh no" } } } }; for ^20 { $msg.emit($_); say "sent $_"; }; $msg.done; sleep 2;
(exit code 1)
sent 0
Unhandled exception in code scheduled on thread 4
sent 1
sent 2
sent 3
sent 4
sent 5
sent 6
sent 7
sent 8
sent 9
sent 10
sent 11
sent 12
sent 13
sent 14
sent 15
sent 16
sent 17
sent 18
sent 19
0
1
2
3
4
5
cannot write to closed socket
A react block:
in block at /tmp/LZz9WHYMVz line 1
Died because of the exception:
oh no
in block at /tmp/LZz9WHYMVz line 1
in block at /tmp/LZz9WHYMVz line 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment