LanguageExt.Pipes

LanguageExt.Pipes Concurrent Sink

Contents

class Sink Source #

Methods

method K<Sink, A> Contramap <A, B> (K<Sink, B> fb, Func<A, B> f) Source #

method K<Sink, A> Divide <A, B, C> (Func<A, (B Left, C Right)> f, K<Sink, B> fb, K<Sink, C> fc) Source #

method K<Sink, A> Conquer <A> () Source #

method K<Sink, A> Lose <A> (Func<A, Void> f) Source #

method K<Sink, A> Route <A, B, C> (Func<A, Either<B, C>> f, K<Sink, B> fb, K<Sink, C> fc) Source #

record Sink <A> Source #

Entry point to a channel. Sinkes 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<B> Contramap <B> (Func<B, A> f) Source #

Contravariant functor map

method Sink<A> Combine (Sink<A> rhs) Source #

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

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

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

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

where M : Monad<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 Sinkes 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