Table of Contents

Class ClientObservable<T>

Namespace
Cratis.Applications.Queries
Assembly
Cratis.Applications.dll

Represents an implementation of IClientObservable.

public class ClientObservable<T> : IClientObservable, IAsyncEnumerable<T>

Type Parameters

T

Type of data being observed.

Inheritance
ClientObservable<T>
Implements
Inherited Members

Remarks

Initializes a new instance of the ClientObservable<T> class.

Constructors

ClientObservable(QueryContext, ISubject<T>, JsonOptions, IWebSocketConnectionHandler, IHostApplicationLifetime, ILogger<ClientObservable<T>>)

Represents an implementation of IClientObservable.

public ClientObservable(QueryContext queryContext, ISubject<T> subject, JsonOptions jsonOptions, IWebSocketConnectionHandler webSocketConnectionHandler, IHostApplicationLifetime hostApplicationLifetime, ILogger<ClientObservable<T>> logger)

Parameters

queryContext QueryContext

The QueryContext the observable is for.

subject ISubject<T>

The System.Reactive.Subjects.ISubject<T> the observable wraps.

jsonOptions JsonOptions

The JsonOptions.

webSocketConnectionHandler IWebSocketConnectionHandler

The IWebSocketConnectionHandler.

hostApplicationLifetime IHostApplicationLifetime

The IHostApplicationLifetime.

logger ILogger<ClientObservable<T>>

The ILogger.

Remarks

Initializes a new instance of the ClientObservable<T> class.

Methods

GetAsyncEnumerator(CancellationToken)

Returns an enumerator that iterates asynchronously through the collection.

public IAsyncEnumerator<T> GetAsyncEnumerator(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A CancellationToken that may be used to cancel the asynchronous iteration.

Returns

IAsyncEnumerator<T>

An enumerator that can be used to iterate asynchronously through the collection.

GetAsynchronousEnumerator(CancellationToken)

Get an async enumerator for the observable.

public object GetAsynchronousEnumerator(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Optional CancellationToken.

Returns

object

Async enumerator.

HandleConnection(ActionExecutingContext)

Handle the action context and result from the action.

public Task HandleConnection(ActionExecutingContext context)

Parameters

context ActionExecutingContext

ActionExecutingContext to handle for.

Returns

Task

A Task representing the asynchronous operation.

OnNext(T)

Notifies all subscribed and future observers about the arrival of the specified element in the sequence.

public void OnNext(T next)

Parameters

next T

The value to send to all observers.