LanguageExt.Streaming

LanguageExt.Streaming SinkT

Contents

Sub modules

DSL

class SinkT <M> Source #

where M : MonadIO<M>

record SinkT <M, A> Source #

where M : MonadIO<M>

Entry point to a channel. Sinks receive values and propagate them through the channel they're attached to. The behaviour depends on the Buffer type they were created with.

Parameters

type M

Lifted type

type A

Value type

Properties

property SinkT<M, A> Empty Source #

Sink that is closed and can't be posted to without an error being raised

property SinkT<M, A> Void Source #

Sink that swallows everything silently

Methods

method K<M, Unit> PostM (K<M, A> ma) Source #

Post a value to the sink

Raises Errors.NoSpaceInSink if the sink is full or closed.

Parameters

param ma

Value to post

returns

IO computation that represents the posting

method K<M, Unit> Post (A value) Source #

Post a value to the sink

Raises Errors.NoSpaceInSink if the sink is full or closed.

Parameters

param value

Value to post

returns

IO computation that represents the posting

method K<M, Unit> Complete () Source #

Complete and close the sink

method K<M, Unit> Fail (Error Error) Source #

Complete and close the sink with an Error

method SinkT<M, X> Comap <X> (Func<X, A> f) Source #

Contravariant functor map

method SinkT<M, X> Comap <X> (TransducerM<M, X, A> f) Source #

Contravariant functor map

method SinkT<M, A> Combine (SinkT<M, A> rhs) Source #

Combine two Sinks: lhs and rhs into a single Sink that takes incoming values and then posts to the lhs and rhs Sinks.

method SinkT<M, X> Combine <X, B> (Func<X, (A Left, B Right)> f, SinkT<M, B> rhs) Source #

Combine two Sinks: lhs and rhs into a single Sink that takes incoming values, maps them to an (A, B) tuple, and then posts the first and second elements to the lhs and rhs Sinks.

method ConsumerT<A, M, Unit> ToConsumerT () Source #

Convert the Sink to a ConsumerT pipe component

Parameters

type M

Monad to lift (must support IO)

returns

ConsumerT

Operators

operator + (SinkT<M, A> lhs, SinkT<M, A> rhs) Source #

Combine two Sinks into a single Source. The values are both merged into a new Sink.

Parameters

param lhs

Left-hand side

param rhs

Right-hand side

returns

Merged stream of values

class SinkTExtensions Source #

Methods

method SinkT<M, A> As <M, A> (this K<SinkT<M>, A> ma) Source #

where M : MonadIO<M>

Downcast

method Consumer<RT, A, Unit> ToConsumer <RT, A> (this SinkT<Eff<RT>, A> ma) Source #

Convert the Sink to a Consumer pipe component

Parameters

returns

Consumer

class SinkT Source #

Methods

method SinkT<M, A> lift <M, A> (Channel<K<M, A>> channel) Source #

where M : MonadIO<M>

Create a sink from a System.Threading.Channels.Channel.

Parameters

type A

Bound value type

param channel

Channel to lift

returns

Constructed sink