Path: redb-route/redb.Route/Processors/RoutePolicyProcessor.cs Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/redb.Route/Processors/RoutePolicyProcessor.cs ---- using redb.Route.Abstractions; namespace redb.Route.Processors; /// /// Wraps a pipeline processor with / /// calls. Only created for routes that have a policy. /// internal sealed class RoutePolicyProcessor : IProcessor { private readonly IProcessor _next; private readonly IRoutePolicy _policy; private readonly IRouteContext _context; public RoutePolicyProcessor(IProcessor next, IRoutePolicy policy, IRouteContext context) { _next = next; _policy = policy; _context = context; } public async Task Process(IExchange exchange, CancellationToken ct = default) { await _policy.OnExchangeBegin(_context, exchange, ct).ConfigureAwait(false); try { await _next.Process(exchange, ct).ConfigureAwait(false); } finally { await _policy.OnExchangeDone(_context, exchange, ct).ConfigureAwait(false); } } }