Class SamplingProcessor

Assembly: redb.Route.dll

Samples messages from the stream, allowing only a subset to pass through.
Supports two modes: count-based (every Nth message) and time-based (at most one per period).
Non-sampled messages are stopped via .
Thread-safe via lock-free atomic operations.

public class SamplingProcessor : IProcessor

Inheritance

Object→SamplingProcessor

Implements

Methods

Process(IExchange, CancellationToken)

Processes the exchange asynchronously.

public Task Process(IExchange exchange, CancellationToken ct = default)

Constructors

SamplingProcessor(long)

Creates a count-based sampler that passes every Nth message.

SamplingProcessor(TimeSpan)

Creates a time-based sampler that passes at most one message per period.