Class FilterProcessor
Evaluates a predicate on the exchange and passes through only if true.
When predicate returns false, the exchange is skipped (no processing).
The predicate is held as an and awaited through
, so a predicate that has to consult a store or a
service can do so without blocking. A plain delegate is wrapped in a
at the boundary.
public class FilterProcessor : IProcessor
Inheritance
Implements
Methods
Process(IExchange, CancellationToken)
Processes the exchange asynchronously.
public Task Process(IExchange exchange, CancellationToken ct = default)
Constructors
FilterProcessor(Func<IExchange, bool>, IProcessor)
Creates a filter processor from a delegate, wrapped as a .
FilterProcessor(IPredicate, IProcessor)
Creates a filter processor from a predicate instance.