Interface IObservableQueryHandler
- Namespace
- Cratis.Applications.Queries
- Assembly
- Cratis.Applications.dll
Defines a handler for WebSocket-based query operations.
public interface IObservableQueryHandler
- Extension Methods
Methods
HandleStreamingResult(HttpContext, QueryName, object, QueryContext)
Handles a streaming query result for WebSocket connections in minimal API endpoints.
Task HandleStreamingResult(HttpContext httpContext, QueryName queryName, object streamingData, QueryContext queryContext)
Parameters
httpContextHttpContextThe HttpContext for the request.
queryNameQueryNameThe name of the query being executed.
streamingDataobjectThe streaming data (Subject or AsyncEnumerable).
queryContextQueryContextThe query context.
Returns
HandleStreamingResult(ActionExecutingContext, ActionExecutedContext?, ObjectResult)
Handles a streaming query result for WebSocket connections in controller actions.
Task HandleStreamingResult(ActionExecutingContext context, ActionExecutedContext? actionExecutedContext, ObjectResult objectResult)
Parameters
contextActionExecutingContextactionExecutedContextActionExecutedContextThe ActionExecutedContext from the action execution.
objectResultObjectResultThe ObjectResult containing the streaming data.
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(HttpContext)
Determines if the current request should be handled as a WebSocket connection.
bool ShouldHandleAsWebSocket(HttpContext httpContext)
Parameters
httpContextHttpContextThe HttpContext.
Returns
- bool
True if the request should be handled as WebSocket, false otherwise.
ShouldHandleAsWebSocket(ActionExecutingContext)
Determines if the current request should be handled as a WebSocket connection.
bool ShouldHandleAsWebSocket(ActionExecutingContext context)
Parameters
contextActionExecutingContext
Returns
- bool
True if the request should be handled as WebSocket, false otherwise.