Interface IObservableQueryHandler
- Namespace
- Cratis.Arc.Queries
- Assembly
- Cratis.Arc.Core.dll
Defines a handler for observable/streaming (WebSocket-based) query operations.
public interface IObservableQueryHandler
- Extension Methods
Methods
HandleStreamingResult(IHttpRequestContext, QueryName, object)
Handles a streaming query result for WebSocket connections.
Task HandleStreamingResult(IHttpRequestContext context, QueryName queryName, object streamingData)
Parameters
contextIHttpRequestContextThe IHttpRequestContext.
queryNameQueryNameThe name of the query being executed.
streamingDataobjectThe streaming data (Subject or AsyncEnumerable).
Returns
IsStreamingResult(object?)
Determines if the given data is a streaming result that can be handled via WebSocket.
bool IsStreamingResult(object? data)
Parameters
dataobjectThe data to check.
Returns
- bool
True if the data is a streaming result, false otherwise.
ShouldHandleAsWebSocket(IHttpRequestContext)
Determines if the current request should be handled as a WebSocket connection.
bool ShouldHandleAsWebSocket(IHttpRequestContext context)
Parameters
contextIHttpRequestContextThe IHttpRequestContext.
Returns
- bool
True if the request should be handled as WebSocket, false otherwise.