Class ServerSentEventsMiddleware<TServerSentEventsService>
Middleware which provides support for Server-Sent Events protocol.
Inherited Members
Namespace: Lib.AspNetCore.ServerSentEvents
Assembly: Lib.AspNetCore.ServerSentEvents.dll
Syntax
public class ServerSentEventsMiddleware<TServerSentEventsService> where TServerSentEventsService : ServerSentEventsService
Type Parameters
| Name | Description |
|---|---|
| TServerSentEventsService |
Constructors
ServerSentEventsMiddleware(RequestDelegate, IAuthorizationPolicyProvider, IServerSentEventsClientIdProvider, IServerSentEventsNoReconnectClientsIdsStore, TServerSentEventsService, IOptions<ServerSentEventsOptions>, ILoggerFactory)
Initializes new instance of middleware.
Declaration
public ServerSentEventsMiddleware(RequestDelegate next, IAuthorizationPolicyProvider policyProvider, IServerSentEventsClientIdProvider serverSentEventsClientIdProvider, IServerSentEventsNoReconnectClientsIdsStore serverSentEventsNoReconnectClientsIdsStore, TServerSentEventsService serverSentEventsService, IOptions<ServerSentEventsOptions> serverSentEventsOptions, ILoggerFactory loggerFactory)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestDelegate | next | The next delegate in the pipeline. |
| IAuthorizationPolicyProvider | policyProvider | The service which can provide an AuthorizationPolicy. |
| IServerSentEventsClientIdProvider | serverSentEventsClientIdProvider | The provider of identifiers for IServerSentEventsClient instances. |
| IServerSentEventsNoReconnectClientsIdsStore | serverSentEventsNoReconnectClientsIdsStore | The store which keeps identifiers of IServerSentEventsClient which shouldn't be allowed to reconnect. |
| TServerSentEventsService | serverSentEventsService | The service which provides operations over Server-Sent Events protocol. |
| IOptions<ServerSentEventsOptions> | serverSentEventsOptions | |
| ILoggerFactory | loggerFactory | The logger factory. |
Methods
Invoke(HttpContext, IPolicyEvaluator)
Process an individual request.
Declaration
public Task Invoke(HttpContext context, IPolicyEvaluator policyEvaluator)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpContext | context | The context. |
| IPolicyEvaluator | policyEvaluator | The service which can evaluate an AuthorizationPolicy. |
Returns
| Type | Description |
|---|---|
| Task | The task object representing the asynchronous operation. |