on master help sign in
Remove 'eval', just keep parEval in conc folds
commit0e14d7182207e54d0c9c30cc9d094b8a3aec29bf authorHarendra Kumar <harendra@composewell.com> dateSat 22 Apr 2023, 19:53 (4 years ago) parent9364c0f
2 files changed+7−8
src/Streamly/Internal/Data/Fold/Concurrent.hs+4−6 src/Streamly/Internal/Data/Fold/Concurrent/Channel.hs+3−2
src/Streamly/Internal/Data/Fold/Concurrent.hs+4−6
@@ -18,9 +18,6 @@
1818
1919module Streamly.Internal.Data.Fold.Concurrent
2020 (
21− -- * Imports
22− -- $setup
23−
2421 -- * Configuration
2522 Config
2623 , maxBuffer
@@ -30,13 +27,12 @@ module Streamly.Internal.Data.Fold.Concurrent
3027 -- * Combinators
3128 -- | Stream combinators using Async channel
3229
33− , eval
3430 , parEval
3531 )
3632where
3733
38−import Streamly.Internal.Control.Concurrent (MonadAsync)
39−import Streamly.Internal.Data.Fold (Fold)
34+-- import Streamly.Internal.Control.Concurrent (MonadAsync)
35+-- import Streamly.Internal.Data.Fold (Fold)
4036
4137import Streamly.Internal.Data.Fold.Concurrent.Channel
4238
@@ -60,6 +56,7 @@ import Streamly.Internal.Data.Fold.Concurrent.Channel
6056-- return n -- IO Int
6157-- :}
6258
59+{-
6360-- | Evaluate a stream asynchronously using a channel and serve the consumer
6461-- from the evaluation buffer.
6562--
@@ -68,3 +65,4 @@ import Streamly.Internal.Data.Fold.Concurrent.Channel
6865{-# INLINE eval #-}
6966eval :: MonadAsync m => Fold m a b -> Fold m a b
7067eval = parEval id
68+-}
src/Streamly/Internal/Data/Fold/Concurrent/Channel.hs+3−2
@@ -40,8 +40,9 @@ import Streamly.Internal.Data.Stream.Channel.Types
4040
4141-- XXX Cleanup the fold if the stream is interrupted. Add a GC hook.
4242
43−-- | Evaluate the fold asynchronously in a worker thread separate from the
44−-- driver thread.
43+-- | Evaluate a fold asynchronously using a concurrent channel. The driver just
44+-- queues the input stream values to the fold channel buffer and returns. The
45+-- fold evaluates the queued values asynchronously.
4546--
4647{-# INLINABLE parEval #-}
4748parEval :: MonadAsync m => (Config -> Config) -> Fold m a b -> Fold m a b