LanguageExt.Pipes

LanguageExt.Pipes Concurrent Inbox

Contents

class Inbox Source #

Methods

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

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

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

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

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

record Inbox <A> Source #

Entry point to a channel. Inboxes 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 Inbox<A> Empty Source #

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

property Inbox<A> Void Source #

Inbox that swallows everything silently

Methods

method IO<Unit> Post (A value) Source #

Post a value to the inbox

Raises Errors.NoSpaceInInbox if the inbox 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 inbox

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

Complete and close the inbox with an Error

method Inbox<B> Contramap <B> (Func<B, A> f) Source #

Contravariant functor map

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

Combine two Inboxes: lhs and rhs into a single inbox that takes incoming values and then posts the to the lhs and rhs inboxes.

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

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

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

where M : Monad<M>

Convert the Inbox 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 Inbox to a Consumer pipe component

Parameters

returns

Consumer

Operators

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

Combine two inboxes into a single outbox. The values are both merged into a new inbox.

Parameters

param lhs

Left hand side

param rhs

Right hand side

returns

Merged stream of values

class InboxExtensions Source #

Methods

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

Downcast