on master help sign in
Fix some minor concurrency docs
commitb27474243d0fcfca9c7742f6e7c99526c2a039cd authorHarendra Kumar <harendra@composewell.com> dateMon 2 Jan 2023, 12:05 (4 years ago) parent89eba73
2 files changed+9−6
src/Streamly/Data/Stream/Concurrent.hs+4−3 src/Streamly/Internal/Data/Stream/Concurrent.hs+5−3
src/Streamly/Data/Stream/Concurrent.hs+4−3
@@ -124,18 +124,19 @@ module Streamly.Data.Stream.Concurrent
124124 -- | Stream combinators using a concurrent channel.
125125
126126 -- *** Evaluate
127− -- | Evaluates a stream concurrently using a channel.
127+ -- | Evaluates a serial stream asynchronously using a concurency channel.
128128
129129 -- , eval
130130 , parEval
131131
132132 -- *** Generate
133− -- | Uses a single channel to evaluate mapped actions concurrently.
133+ -- | Uses a concurrency channel to evaluate multiple actions concurrently.
134134 , parRepeatM
135135 , parReplicateM
136136
137137 -- *** Map
138− -- | Uses a single channel to evaluate mapped actions concurrently.
138+ -- | Uses a concurrency channel to evaluate multiple mapped actions
139+ -- concurrently.
139140
140141 -- , mapM
141142 , parMapM
src/Streamly/Internal/Data/Stream/Concurrent.hs+5−3
@@ -181,10 +181,12 @@ parEvalD modifier m = D.Stream step Nothing
181181 D.Stop -> D.Stop
182182-}
183183
184−-- | Evaluate a stream asynchronously using a channel and serve the consumer
185−-- from the evaluation buffer.
184+-- | Evaluate a stream asynchronously. In a serial stream, each element of the
185+-- stream is generated as it is demanded by the consumer. `parEval` evaluates
186+-- multiple elements of the stream ahead of time and serves the results from a
187+-- buffer.
186188--
187−-- Note that the evaluation requires a single thread as only one stream needs
189+-- Note that the evaluation requires only one thread as only one stream needs
188190-- to be evaluated. Therefore, the concurrency options that are relevant to
189191-- multiple streams won't apply here e.g. maxThreads, eager, interleaved,
190192-- ordered, stopWhen options won't have any effect.