Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created October 31, 2016 14:47
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 jnthn/5f7801deffdfc0084a003e957423312c to your computer and use it in GitHub Desktop.
Save jnthn/5f7801deffdfc0084a003e957423312c to your computer and use it in GitHub Desktop.
sub processor($in) {
supply {
whenever $in {
die "oh no";
}
}
}
sub refuses() {
my $fake-in = Supplier.new;
processor($fake-in.Supply).tap:
-> $request {
die "oops 1";
},
quit => -> $exception {
say "ok";
return;
};
$fake-in.emit("XXX");
die "oops 2";
}
for ^200 {
refuses;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment