Class RateLimitingMiddleware
- Namespace
- Signal.Application.Pipeline
- Assembly
- Signal.Application.dll
Drops data messages of senders that exceeded RateLimitOptions. Receipts and typing indicators are not limited.
public sealed class RateLimitingMiddleware : IMessageMiddleware
- Inheritance
-
RateLimitingMiddleware
- Implements
- Inherited Members
Constructors
RateLimitingMiddleware(ISenderRateLimiter, ILogger<RateLimitingMiddleware>)
Drops data messages of senders that exceeded RateLimitOptions. Receipts and typing indicators are not limited.
public RateLimitingMiddleware(ISenderRateLimiter limiter, ILogger<RateLimitingMiddleware> logger)
Parameters
limiterISenderRateLimiterThe rate limiter.
loggerILogger<RateLimitingMiddleware>The logger.
Methods
InvokeAsync(MessageContext, MessageDelegate)
Processes the message. Call next to continue; skip it to stop processing.
public Task InvokeAsync(MessageContext context, MessageDelegate next)
Parameters
contextMessageContextThe message being processed.
nextMessageDelegateThe rest of the pipeline.
Returns
- Task
A task that completes when this step (and everything it invoked) has finished.