namespace Esiur.Protocol;
///
/// Strategy used by EpConnection.FetchResource when it is asked for a resource whose
/// attachment is already in flight. Selectable mainly for experimental A/B/C evaluation of the
/// deadlock-prevention algorithm.
///
public enum DeadlockResolutionMode : byte
{
///
/// Default. Wait for the in-flight attachment to complete, except when a genuine wait-for cycle
/// is detected (same dependency chain, or a cross-chain cycle in the wait-for graph), in which
/// case a placeholder is returned to break it. Never deadlocks and never returns an unnecessary
/// placeholder.
///
WaitWithCycleDetection = 0,
///
/// Legacy behaviour: return the not-yet-attached placeholder to any cross-chain requester of an
/// in-flight resource. Never deadlocks, but delivers partially-attached resources for non-cyclic
/// contention (the bug under study).
///
LegacyCrossChainPlaceholder = 1,
///
/// No cycle handling at all: always wait for the in-flight attachment, even within the same
/// dependency chain. Genuinely deadlocks whenever the request graph contains a cycle. Used only
/// to demonstrate that cycle handling is necessary and that the deadlock detector works.
///
NaiveWait = 2,
}