on master help sign in
Perform first task inline instead of queueing
commit999b6292b8c8480a8fb2b50d7fb7e04748029ac7 authorHarendra Kumar <harendra.kumar@gmail.com> dateSat 2 Sep 2017, 03:04 (9 years ago) parent2e4fc99
1 file changed+3−2
src/Asyncly/AsyncT.hs+3−2
src/Asyncly/AsyncT.hs+3−2
@@ -445,8 +445,9 @@ parallel m1 m2 fair = AsyncT $ \ctx stp yld -> do
445445 -- go left to right. If the left one keeps producing results we
446446 -- may or may not run the right one.
447447 let q = workQueue c
448− queueWork q m1 >> queueWork q m2
449− (runAsyncT (dequeueLoop ctx q fair)) Nothing stp yld
448+ continue = (runAsyncT (dequeueLoop ctx q fair)) Nothing stp yld
449+ queueWork q m2
450+ (runAsyncT m1) ctx continue yld
450451
451452instance MonadAsync m => Alternative (AsyncT m) where
452453 empty = mempty