Table of Contents

Class AsyncSubject<T>

Namespace
Bonsai.Reactive
Assembly
Bonsai.Core.dll

Represents an expression builder that broadcasts the result of the first observable sequence to complete to all subscribed and future observers.

Marble diagram

AsyncSubject stores and passes the last value (and only the last value) emitted by the source sequence to each subscribed observer. The value is also only sent out after the source sequence terminates. If the source sequence does not emit any value, AsyncSubject will also terminate without emitting any values.

Tip

You can use the Take operator before AsyncSubject to store the first value from an infinite sequence.

Any observers which subscribe after the source sequence terminates will immediately receive the stored value. If the source sequence terminates with an error, AsyncSubject will not emit any values but will pass along the error notification to all observers.

[WorkflowElementIcon("AsyncSubject")]
public class AsyncSubject<T> : SubjectBuilder<T>, IExpressionBuilder, INamedElement

Type Parameters

T

The type of the result stored by the subject.

Inheritance
AsyncSubject<T>
Implements
Inherited Members
Extension Methods

Methods

CreateSubject()

Creates a shared subject that broadcasts the result of the first observable sequence to complete to all subscribed and future observers.

protected override ISubject<T> CreateSubject()

Returns

ISubject<T>

A new instance of ISubject<T>.