Class ServerSentEventsMiddleware<TServerSentEventsService>
Middleware which provides support for Server-Sent Events protocol.
Inheritance
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 | 
|---|---|---|
| Microsoft.AspNetCore.Http.RequestDelegate | next | The next delegate in the pipeline.  | 
      
| Microsoft.AspNetCore.Authorization.IAuthorizationPolicyProvider | policyProvider | The service which can provide an Microsoft.AspNetCore.Authorization.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.  | 
      
| Microsoft.Extensions.Options.IOptions<ServerSentEventsOptions> | serverSentEventsOptions | |
| Microsoft.Extensions.Logging.ILoggerFactory | loggerFactory | The logger factory.  | 
      
Methods
Invoke(HttpContext, IPolicyEvaluator)
Process an individual request.
Declaration
public async Task Invoke(HttpContext context, IPolicyEvaluator policyEvaluator)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Microsoft.AspNetCore.Http.HttpContext | context | The context.  | 
      
| Microsoft.AspNetCore.Authorization.Policy.IPolicyEvaluator | policyEvaluator | The service which can evaluate an Microsoft.AspNetCore.Authorization.AuthorizationPolicy.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Threading.Tasks.Task | The task object representing the asynchronous operation.  |