LanguageExt.Streaming

LanguageExt.Streaming Sink

Contents

Sub modules

DSL

class Sink Source #

record Sink <A> Source #

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 A

Value type

Properties

property Sink<A> Empty Source #

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

property Sink<A> Void Source #

Sink that swallows everything silently

Methods

method IO<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 IO<Unit> Complete () Source #

Complete and close the Sink

method IO<Unit> Fail (Error Error) Source #

Complete and close the Sink with an Error

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

Contravariant functor map

method Sink<X> Comap <X> (Transducer<X, A> f) Source #

Contravariant functor map

method Sink<A> Combine (Sink<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 Sink<X> Combine <X, B> (Func<X, (A Left, B Right)> f, Sink<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 <M> () Source #

where M : MonadIO<M>

Convert the Sink to a ConsumerT pipe component

Parameters

type M

Monad to lift (must support IO)

returns

ConsumerT

method Consumer<RT, A, Unit> ToConsumer <RT> () Source #

Convert the Sink to a Consumer pipe component

Parameters

returns

Consumer

Operators

operator + (Sink<A> lhs, Sink<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 SinkExtensions Source #

Methods

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

Downcast

class Sink Source #

Methods

method Sink<A> lift <A> (Channel<A> channel) Source #

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

Parameters

type A

Bound value type

param channel

Channel to lift

returns

Constructed sink