File tree Expand file tree Collapse file tree 2 files changed +2
-11
lines changed
src/Streamly/Internal/Data/Stream Expand file tree Collapse file tree 2 files changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -335,17 +335,7 @@ newFoldSVar stt f = do
335335 -- Add the producer thread-id to the SVar.
336336 liftIO myThreadId >>= modifyThread sv
337337
338- -- XXX move this in fromProducer itself.
339- --
340- -- A wrapper to send a Stop event back to the producer when the fold
341- -- receives a stop from the producer.
342- let pull m = mkStream $ \ st yld _ stp -> do
343- let stop = sendStopToProducer sv >> stp
344- single a = yld a (K. nilM (sendStopToProducer sv))
345- yieldk a r = yld a (pull r)
346- in foldStreamShared st yieldk single stop m
347-
348- void $ doFork (void $ f $ fromStream $ pull $ fromProducer sv)
338+ void $ doFork (void $ f $ fromStream $ fromProducer sv)
349339 (svarMrun sv)
350340 (handleFoldException sv)
351341 return sv
Original file line number Diff line number Diff line change @@ -133,6 +133,7 @@ fromProducer sv = mkStream $ \st yld sng stp -> do
133133 t <- liftIO $ getTime Monotonic
134134 liftIO $ writeIORef (svarStopTime (svarStats sv)) (Just t)
135135 liftIO $ printSVar sv " SVar Done"
136+ sendStopToProducer sv
136137 stp
137138
138139 {-# INLINE processEvents #-}
You can’t perform that action at this time.
0 commit comments