InboxType

PackageAxial.ElmishFlows
Constructs, fills and reads an Inbox`1.

Specification

Kind
Type
Members
11
Examples
0
scopedWithSignature
Inbox.scopedWith strategy
scopedSlidingSignature
Inbox.scopedSliding capacity
scopedDroppingSignature
Inbox.scopedDropping capacity
scopedBoundedSignature
Inbox.scopedBounded capacity
scopedUnboundedSignature
Inbox.scopedUnbounded ()

Summary

NameSignatureSynopsis
Create inboxes
scopedWithInbox.scopedWith strategyAn inbox whose queue is shut down when the current scope closes, with the given strategy.
scopedSlidingInbox.scopedSliding capacityA non-blocking inbox in which the newest pending value survives a burst; the oldest is dropped.
scopedDroppingInbox.scopedDropping capacityA non-blocking inbox in which the oldest pending value survives; a newer offer is dropped.
scopedBoundedInbox.scopedBounded capacityA lossless inbox in which an offer waits while the mailbox is full.
scopedUnboundedInbox.scopedUnbounded ()A lossless inbox that never waits; memory grows with the backlog.
createInbox.create capacity runtimeAn inbox shut down by the runtime instead of a scope, for a host that already holds the runtime.
Offer values
postInbox.post value inboxOffers a value; returns whether the mailbox took it, false when it is full or shut down.
offerInbox.offer value inboxThe same offer, as a command for update to return.
Read the mailbox
streamInbox.stream inboxThe mailbox as a stream: every accepted value, in the order it was offered.
droppedInbox.dropped inboxOffers that were made when the mailbox was full and could not be kept.
Droppedthis.DroppedOffers made when the mailbox was full and could not wait.

Create inboxes

Build the mailbox in the scope that will shut it down, naming its overflow strategy.

kind:membertask:create

scopedWith

Inbox.scopedWith strategy
Member
An inbox whose queue is shut down when the current scope closes, with the given strategy.

Parameters

NameTypeDescription
strategyQueueStrategyWhat happens when the mailbox is full: wait, slide, drop, or grow.

Returns

Flow<'env, Never, Inbox<'value>>
kind:membertask:create

scopedSliding

Inbox.scopedSliding capacity
Member
A non-blocking inbox in which the newest pending value survives a burst; the oldest is dropped.

Parameters

NameTypeDescription
capacityint

Returns

Flow<'env, Never, Inbox<'value>>
kind:membertask:create

scopedDropping

Inbox.scopedDropping capacity
Member
A non-blocking inbox in which the oldest pending value survives; a newer offer is dropped.

Parameters

NameTypeDescription
capacityint

Returns

Flow<'env, Never, Inbox<'value>>
kind:membertask:create

scopedBounded

Inbox.scopedBounded capacity
Member
A lossless inbox in which an offer waits while the mailbox is full.

Parameters

NameTypeDescription
capacityint

Returns

Flow<'env, Never, Inbox<'value>>
kind:membertask:create

scopedUnbounded

Inbox.scopedUnbounded ()
Member
A lossless inbox that never waits; memory grows with the backlog.

Parameters

NameTypeDescription
unit

Returns

Flow<'env, Never, Inbox<'value>>
kind:membertask:create

create

Inbox.create capacity runtime
Member
An inbox shut down by the runtime instead of a scope, for a host that already holds the runtime.

Parameters

NameTypeDescription
capacityint
runtimeElmishRuntime<'env>

Returns

Inbox<'value>

Offer values

Hand values to the program from update or from a synchronous callback.

kind:membertask:offer

post

Inbox.post value inbox
Member
Offers a value; returns whether the mailbox took it, false when it is full or shut down.

Parameters

NameTypeDescription
value'value
inboxInbox<'value>

Returns

bool
kind:membertask:offer

offer

Inbox.offer value inbox
Member
The same offer, as a command for update to return.

Parameters

NameTypeDescription
value'value
inboxInbox<'value>

Returns

Cmd<'msg>

Read the mailbox

Read values as a stream and count the offers a full mailbox could not keep.

kind:membertask:read

stream

Inbox.stream inbox
Member
The mailbox as a stream: every accepted value, in the order it was offered.

Parameters

NameTypeDescription
inboxInbox<'value>

Returns

FlowStream<'env, 'error, 'value>
kind:membertask:read

dropped

Inbox.dropped inbox
Member
Offers that were made when the mailbox was full and could not be kept.

Parameters

NameTypeDescription
inboxInbox<'value>

Returns

int64
kind:membertask:read

Dropped

this.Dropped
Member
Offers made when the mailbox was full and could not wait.

Returns

int64