Path: redb-route/redb.Route/Abstractions/IInflightRepository.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/Abstractions/IInflightRepository.cs
----
namespace redb.Route.Abstractions;
///
/// Tracks exchanges currently being processed (in-flight) across all routes.
/// Thread-safe. Used by watchdog/monitoring to detect hung exchanges.
///
public interface IInflightRepository
{
/// Registers an exchange as in-flight.
void Register(InflightExchange entry);
/// Removes an exchange from the in-flight registry.
void Unregister(string exchangeId);
/// Returns a snapshot of all in-flight exchanges.
IReadOnlyList Browse();
/// Returns a snapshot of in-flight exchanges for a specific route.
IReadOnlyList Browse(string routeId);
/// Total number of in-flight exchanges across all routes.
int Count { get; }
/// Number of in-flight exchanges for a specific route.
int CountByRoute(string routeId);
///
/// Marks an in-flight exchange as held by the engine on purpose for (a redelivery delay, a
/// delay step): is set until the returned handle is disposed, then
/// . A monitor does not take such an exchange for a hung one. The
/// default does nothing, so a repository of one's own keeps working as before.
///
IDisposable BeginWait(string exchangeId, TimeSpan delay) => NoWait.Instance;
/// The handle of a wait nothing records.
private sealed class NoWait : IDisposable
{
public static readonly NoWait Instance = new();
public void Dispose() { }
}
}