Table of Contents

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

limiter ISenderRateLimiter

The rate limiter.

logger ILogger<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

context MessageContext

The message being processed.

next MessageDelegate

The rest of the pipeline.

Returns

Task

A task that completes when this step (and everything it invoked) has finished.