Skip to content

Instantly share code, notes, and snippets.

@jnthn

jnthn/x.p6 Secret

Created December 18, 2018 23:51
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/2a350ca7d9770ab5bd8019129428e393 to your computer and use it in GitHub Desktop.
Save jnthn/2a350ca7d9770ab5bd8019129428e393 to your computer and use it in GitHub Desktop.
my $s1 = supply {
whenever Promise.in(1) {
die "oops";
}
}
my $s2 = supply {
whenever Supply.interval(0.5).head(5) {
.emit;
}
}
my $ex;
react {
whenever $s1 {
QUIT {
default {
say "caught";
$ex //= $_;
}
}
}
whenever $s2 { .say }
}
$ex.?rethrow;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment