File tree Expand file tree Collapse file tree 4 files changed +18
-67
lines changed Expand file tree Collapse file tree 4 files changed +18
-67
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ module Examples where
142142 liftEff $ trace " Testing Par (<|>) - kill two"
143143 test_parRaceKill2
144144
145- -- liftEff $ trace "Testing cancel of Par (<|>)"
146- -- test_cancelPar
145+ liftEff $ trace " Testing cancel of Par (<|>)"
146+ test_cancelPar
147147
148148 liftEff $ trace " Done testing"
Original file line number Diff line number Diff line change @@ -318,15 +318,17 @@ module Control.Monad.Aff
318318 var onCanceler = function(){};
319319
320320 canceler1 = aff(function(v) {
321- if (!requestCancel) {
321+ if (requestCancel) {
322+ isCanceled = true;
323+
324+ return alwaysCanceler;
325+ } else {
322326 canceler2 = f(v)(success, error);
323327
324328 onCanceler(canceler2);
325- } else {
326- isCanceled = true;
327- }
328329
329- return canceler;
330+ return canceler2;
331+ }
330332 }, error);
331333
332334 return function(e) {
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ module Control.Monad.Aff.Par
5656 ve <- makeVar' 0 -- the error count (starts at 0)
5757 c1 <- forkAff $ attempt a1 >>= either (maybeKill va ve ) (putVar va )
5858 c2 <- forkAff $ attempt a2 >>= either (maybeKill va ve ) (putVar va )
59- (takeVar va ) `cancelWith ` (c1 <> c2 )
59+ (takeVar va ) -- `cancelWith` (c1 <> c2)
6060
6161 instance plusPar :: Plus (Par e ) where
6262 empty = Par empty
You can’t perform that action at this time.
0 commit comments