streamly-0.9.0: Streaming, dataflow programming and declarative concurrency
Copyright(c) 2017 2022 Composewell Technologies
LicenseBSD-3-Clause
Maintainerstreamly@composewell.com
Stabilityexperimental
PortabilityGHC
Safe HaskellSafe-Inferred
LanguageHaskell2010

Streamly.Internal.Data.Fold.Concurrent.Channel.Type

Description

 
Synopsis

Documentation

newChannel :: MonadRunInIO m => (Config -> Config) -> Fold m a b -> m (Channel m a b) Source #

data Config Source #

An abstract type for specifying the configuration parameters of a Channel. Use Config -> Config modifier functions to modify the default configuration. See the individual modifier documentation for default values.

sendToWorker :: MonadAsync m => Channel m a b -> a -> m (Maybe b) Source #

Push values from a driver to a fold worker via a Channel. Before pushing a value to the Channel it polls for events received from the fold worker. If a stop event is received then it returns True otherwise false. Propagates exceptions received from the fold wroker.

checkFoldStatus :: MonadAsync m => Channel m a b -> m (Maybe b) Source #

Poll for events sent by the fold worker to the fold driver. 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.