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

Streamly.Internal.Data.Stream.Concurrent.Channel.Operations

Description

 
Synopsis

Documentation

toChannel :: MonadRunInIO m => Channel m a -> Stream m a -> m () Source #

Send a stream to a given channel for concurrent evaluation.

toChannelK :: MonadRunInIO m => Channel m a -> StreamK m a -> m () Source #

Write a stream to an SVar in a non-blocking manner. The stream can then be read back from the SVar using fromSVar.

fromChannel :: MonadAsync m => Channel m a -> Stream m a Source #

Generate a stream of results from concurrent evaluations from a channel. Evaluation of the channel does not start until this API is called. This API must not be called more than once on a channel. It kicks off evaluation of the channel by dispatching concurrent workers and ensures that as long there is work queued on the channel workers are dispatched proportional to the demand by the consumer.