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
TType 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
queryContextQueryContextThe QueryContext the observable is for.
subjectISubject<T>The System.Reactive.Subjects.ISubject<T> the observable wraps.
readModelInterceptorsIReadModelInterceptorsThe IReadModelInterceptors for intercepting read models.
httpRequestContextAccessorIHttpRequestContextAccessorThe IHttpRequestContextAccessor restored around each emission so tenant resolution sees the subscribing connection, not whatever ambient context the emitting thread happens to carry.
webSocketConnectionHandlerIWebSocketConnectionHandlerhostApplicationLifetimeIHostApplicationLifetimeemissionGuardsIObservableQueryEmissionGuardsThe IObservableQueryEmissionGuards consulted per emission when an application opts in with an IGuardObservableQueryEmission.
loggerILogger<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
contextIHttpRequestContextThe IHttpRequestContext for this connection.
Returns
OnNext(T)
Notifies all subscribed and future observers about the arrival of the specified element in the sequence.
public void OnNext(T next)
Parameters
nextTThe value to send to all observers.