Copyright | (c) 2017 Composewell Technologies |
---|---|
License | BSD-3-Clause |
Maintainer | streamly@composewell.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- write :: MonadIO m => SVar t m a -> Maybe WorkerInfo -> Fold m a ()
- writeLimited :: MonadIO m => SVar t m a -> Maybe WorkerInfo -> Fold m a ()
Documentation
write :: MonadIO m => SVar t m a -> Maybe WorkerInfo -> Fold m a () Source #
A fold to write a stream to an SVar. Unlike toSVar
this does not allow
for concurrent evaluation of the stream, as the fold receives the input one
element at a time, it just forwards the elements to the SVar. However, we
can safely execute the fold in an independent thread, the SVar can act as a
buffer decoupling the sender from the receiver. Also, we can have multiple
folds running concurrently pusing the streams to the SVar.
writeLimited :: MonadIO m => SVar t m a -> Maybe WorkerInfo -> Fold m a () Source #
Like write, but applies a yield limit.