Path: redb-route/redb.Route/Processors/InflightTrackingProcessor.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/InflightTrackingProcessor.cs ---- using redb.Route.Abstractions; namespace redb.Route.Processors; /// /// Outermost pipeline wrapper that registers/unregisters exchanges /// in the . Wraps even StatisticsProcessor. /// Guarantees unregister via finally block. /// internal sealed class InflightTrackingProcessor : IProcessor { private readonly IProcessor _inner; private readonly IInflightRepository _repository; private readonly string _routeId; private readonly string? _fromEndpoint; public InflightTrackingProcessor( IProcessor inner, IInflightRepository repository, string routeId, string? fromEndpoint = null) { _inner = inner ?? throw new ArgumentNullException(nameof(inner)); _repository = repository ?? throw new ArgumentNullException(nameof(repository)); _routeId = routeId; _fromEndpoint = fromEndpoint; } public async Task Process(IExchange exchange, CancellationToken ct = default) { var entry = new InflightExchange( exchange.ExchangeId, _routeId, DateTime.UtcNow, Environment.CurrentManagedThreadId, _fromEndpoint); _repository.Register(entry); try { await _inner.Process(exchange, ct).ConfigureAwait(false); } finally { _repository.Unregister(exchange.ExchangeId); } } }