Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't lose exceptions in Channel.Supply.
  • Loading branch information
jnthn committed Mar 9, 2016
1 parent fac3d74 commit 6184e15
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/core/Channel.pm
Expand Up @@ -107,11 +107,19 @@ my class Channel {
emit got;
}
self!peek();
done() if $!closed_promise;
if $!closed_promise {
$!closed_promise.status == Kept
?? done()
!! die $!closed_promise.cause
}
whenever $!async-notify.unsanitized-supply.schedule-on($*SCHEDULER) {
my Mu \got = self.poll;
if nqp::eqaddr(got, Nil) {
done() if $!closed_promise;
if $!closed_promise {
$!closed_promise.status == Kept
?? done()
!! die $!closed_promise.cause
}
}
else {
emit got;
Expand Down

0 comments on commit 6184e15

Please sign in to comment.