Skip to content

Commit

Permalink
Catch exception when trying to keep/break the closed promise
Browse files Browse the repository at this point in the history
This is just a workaround until we figure out how to avoid !peek
encountering a CHANNEL_CLOSE/CHANNEL_FAIL more than once.
  • Loading branch information
dumarchie committed Sep 4, 2019
1 parent 0f31d35 commit 5aa998f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core.c/Channel.pm6
Expand Up @@ -103,11 +103,11 @@ my class Channel does Awaitable {
Nil
} else {
if nqp::istype(msg, CHANNEL_CLOSE) {
$!closed_promise_vow.keep(Nil);
try $!closed_promise_vow.keep(Nil);
Nil
}
elsif nqp::istype(msg, CHANNEL_FAIL) {
$!closed_promise_vow.break(msg.error);
try $!closed_promise_vow.break(msg.error);
Nil
}
else {
Expand Down

0 comments on commit 5aa998f

Please sign in to comment.