Class ClientObservable<T>

Namespace
Cratis.Arc.Queries
Assembly
Cratis.Arc.Core.dll

Represents an implementation of IClientObservable.

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

Type Parameters

T

Type of data being observed.

Inheritance
ClientObservable<T>
Implements
Inherited Members
Extension Methods

Remarks

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

Constructors

ClientObservable(QueryContext, ISubject<T>, IReadModelInterceptors, IHttpRequestContextAccessor, IWebSocketConnectionHandler, IHostApplicationLifetime, IObservableQueryEmissionGuards, ILogger<ClientObservable<T>>)

Represents an implementation of IClientObservable.

public ClientObservable(QueryContext queryContext, ISubject<T> subject, IReadModelInterceptors readModelInterceptors, IHttpRequestContextAccessor httpRequestContextAccessor, IWebSocketConnectionHandler webSocketConnectionHandler, IHostApplicationLifetime hostApplicationLifetime, IObservableQueryEmissionGuards emissionGuards, 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.

readModelInterceptors IReadModelInterceptors

The IReadModelInterceptors for intercepting read models.

httpRequestContextAccessor IHttpRequestContextAccessor

The IHttpRequestContextAccessor restored around each emission so tenant resolution sees the subscribing connection, not whatever ambient context the emitting thread happens to carry.

webSocketConnectionHandler IWebSocketConnectionHandler

The IWebSocketConnectionHandler.

hostApplicationLifetime IHostApplicationLifetime

The IHostApplicationLifetime.

emissionGuards IObservableQueryEmissionGuards

The IObservableQueryEmissionGuards consulted per emission when an application opts in with an IGuardObservableQueryEmission.

logger ILogger<ClientObservable<T>>

The ILogger.

Remarks

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

Methods

HandleConnectionCore(IHttpRequestContext)

Transport-specific connection handling implemented by each derived class.

protected override Task HandleConnectionCore(IHttpRequestContext context)

Parameters

context IHttpRequestContext

The IHttpRequestContext for this connection.

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.