Class ClientObservableSSE<T>

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

Represents an implementation of IClientObservable that uses Server-Sent Events (SSE) for streaming.

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

Type Parameters

T

Type of data being observed.

Inheritance
ClientObservableSSE<T>
Implements
Inherited Members
Extension Methods

Remarks

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

Constructors

ClientObservableSSE(QueryContext, ISubject<T>, IReadModelInterceptors, IHttpRequestContextAccessor, IOptions<ArcOptions>, IHostApplicationLifetime, IObservableQueryEmissionGuards, ILogger<ClientObservableSSE<T>>)

Represents an implementation of IClientObservable that uses Server-Sent Events (SSE) for streaming.

public ClientObservableSSE(QueryContext queryContext, ISubject<T> subject, IReadModelInterceptors readModelInterceptors, IHttpRequestContextAccessor httpRequestContextAccessor, IOptions<ArcOptions> arcOptions, IHostApplicationLifetime hostApplicationLifetime, IObservableQueryEmissionGuards emissionGuards, ILogger<ClientObservableSSE<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.

arcOptions IOptions<ArcOptions>

The ArcOptions.

hostApplicationLifetime IHostApplicationLifetime

The IHostApplicationLifetime.

emissionGuards IObservableQueryEmissionGuards

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

logger ILogger<ClientObservableSSE<T>>

The ILogger.

Remarks

Initializes a new instance of the ClientObservableSSE<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.