Fold the supplied stream to the SVar asynchronously using Parallel concurrency style. {-# INLINE [1] toSVarParallel #-}
Modulestreamly-0.10.1Haskell2010
Streamly.Internal.Data.Stream.SVar
Deprecated. This module will be removed in future.
- 9 values
- Packagestreamly-0.10.1
- Exports9
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceEliminate.hs
Create a Fold style SVar that runs a supplied fold function as the consumer. Any elements sent to the SVar are consumed by the supplied fold function.
Like newFoldSVar except that it uses a Fold instead of a fold function.
Poll for events sent by the fold consumer to the stream pusher. The fold
consumer can send a Stop event or an exception. When a Stop is received
this function returns True. If an exception is recieved then it throws the
exception.
Push values from a stream to a fold worker via an SVar. Before pushing a value to the SVar it polls for events received from the fold consumer. If a stop event is received then it returns True otherwise false. Propagates exceptions received from the fold consumer.
Tap a stream and send the elements to the specified SVar in addition to yielding them again. The SVar runs a fold consumer. Elements are tapped and sent to the SVar until the fold finishes. Any exceptions from the fold evaluation are propagated in the current thread.
------input stream---------output stream----->
/|\ |
exceptions | | input
| \|/
----SVar
|
Fold
Generate a stream from an SVar. An unevaluated stream can be pushed to an SVar using toSVar. As we pull a stream from the SVar the input stream gets evaluated concurrently. The evaluation depends on the SVar style and the configuration parameters e.g. using the maxBuffer/maxThreads combinators.
Like fromSVar but generates a StreamD style stream instead of CPS.