DepartureFixture

sealed interface DepartureFixture

What a source's leave signal is, for the one peer this suite drives through arrival and departure.

Two arms rather than a nullable "cause a departure" hook, because the absent case is not an absence of information — it is a claim, and a checkable one. A null hook would say "I cannot reach this state" in a value nobody has to defend, and every property keyed on it would go green by not running: the vacuity would simply move one level up, where it is harder to see. Declaring NoLeaveSignal instead subscribes the source to an obligation of its own — it must then emit nothing, ever, including when a peer arrives.

Modelled on BoltConformanceSuite's DurabilityFixture. As there, both arms are states a source may legitimately be in: a transport with no leave signal is not broken, it is limited, and that limitation is exactly what discoveryRoster's ghost caveat is about.

Inheritors

Types

Link copied to clipboard
class Emits(val cause: suspend () -> Unit) : DepartureFixture

The source has a real leave signal, and cause makes the peer that DiscoverySourceConformanceSuite.causeArrival brings in leave.

Link copied to clipboard

The source genuinely has no leave signal — a fixed-roster fake, a platform stub, a browse API that only ever reports arrivals — and its departures() is therefore emptyFlow().