Class ThrottlingSentinelMiddleware
- Namespace
- Cuemon.AspNetCore.Http.Throttling
- Assembly
- Cuemon.AspNetCore.dll
Provides an API throttling middleware implementation for ASP.NET Core.
public class ThrottlingSentinelMiddleware : ConfigurableMiddleware<IThrottlingCache, ThrottlingSentinelOptions>, IConfigurable<ThrottlingSentinelOptions>
- Inheritance
-
ThrottlingSentinelMiddleware
- Implements
- Inherited Members
Constructors
ThrottlingSentinelMiddleware(RequestDelegate, IOptions<ThrottlingSentinelOptions>)
Initializes a new instance of the ThrottlingSentinelMiddleware class.
public ThrottlingSentinelMiddleware(RequestDelegate next, IOptions<ThrottlingSentinelOptions> setup)
Parameters
next
RequestDelegateThe delegate of the request pipeline to invoke.
setup
IOptions<ThrottlingSentinelOptions>The ThrottlingSentinelOptions which need to be configured.
ThrottlingSentinelMiddleware(RequestDelegate, Action<ThrottlingSentinelOptions>)
Initializes a new instance of the ThrottlingSentinelMiddleware class.
public ThrottlingSentinelMiddleware(RequestDelegate next, Action<ThrottlingSentinelOptions> setup)
Parameters
next
RequestDelegateThe delegate of the request pipeline to invoke.
setup
Action<ThrottlingSentinelOptions>The ThrottlingSentinelOptions which need to be configured.
Methods
InvokeAsync(HttpContext, IThrottlingCache)
Executes the ThrottlingSentinelMiddleware.
public override async Task InvokeAsync(HttpContext context, IThrottlingCache di)
Parameters
context
HttpContextThe context of the current request.
di
IThrottlingCacheThe dependency injected IThrottlingCache of InvokeAsync(HttpContext, IThrottlingCache).
Returns
- Task
A task that represents the execution of this middleware.