Skip to content

Fix supervision when no child filbers are active #164

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Effect/Aff.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ var Aff = function () {
},
killAll: function (killError, cb) {
return function () {
if (count === 0) {
return cb();
}

var killCount = 0;
var kills = {};

Expand Down
9 changes: 9 additions & 0 deletions test/Test/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,14 @@ test_regression_kill_sync_async = assert "regression/kill-sync-async" do
killFiber (error "Nope.") f1
pure true

test_regression_kill_empty_supervisor ∷ Aff Unit
test_regression_kill_empty_supervisor = assert "regression/kill-empty-supervisor" do
f1 ← forkAff $ supervise $ delay $ Milliseconds 10.0
let
a = parallel $ killFiber (error "Nope.") f1 $> true
b = parallel $ delay (Milliseconds 20.0) $> false
sequential (a <|> b)

main ∷ Effect Unit
main = do
test_pure
Expand Down Expand Up @@ -715,3 +723,4 @@ main = do
test_regression_par_apply_async_canceler
test_regression_bracket_catch_cleanup
test_regression_kill_sync_async
test_regression_kill_empty_supervisor