@@ -212,7 +212,6 @@ pushFork c m1 m2 = AsyncT $ \ctx stp yld -> do
212{-# NOINLINE pull #-}
212{-# NOINLINE pull #-}
213pull :: (MonadIO m, MonadThrow m) => Context a -> AsyncT m a
213pull :: (MonadIO m, MonadThrow m) => Context a -> AsyncT m a
214pull ctx = AsyncT $ \_ stp yld -> do
214pull ctx = AsyncT $ \_ stp yld -> do
215− -- XXX push the try out of the pull loop
216 res <- liftIO $ try (atomically $ readTChan (childChannel ctx))
215 res <- liftIO $ try (atomically $ readTChan (childChannel ctx))
217 case res of
216 case res of
218 Left e ->
217 Left e ->
@@ -232,7 +231,6 @@ pull ctx = AsyncT $ \_ stp yld -> do
232{-# INLINE pullFork #-}
231{-# INLINE pullFork #-}
233pullFork :: MonadAsync m => AsyncT m a -> AsyncT m a -> AsyncT m a
232pullFork :: MonadAsync m => AsyncT m a -> AsyncT m a -> AsyncT m a
234pullFork m1 m2 = AsyncT $ \_ stp yld -> do
233pullFork m1 m2 = AsyncT $ \_ stp yld -> do
235− -- XXX assert ctx is Nothing
236 c <- liftIO $ newContext
234 c <- liftIO $ newContext
237 _ <- doFork (pushBoth c m1 m2) (handlePushException (childChannel c))
235 _ <- doFork (pushBoth c m1 m2) (handlePushException (childChannel c))
238 (runAsyncT (pull c)) (Just c) stp yld
236 (runAsyncT (pull c)) (Just c) stp yld