FlushFixture

sealed interface FlushFixture

What a conformance harness says about Seam.flush, and what it can do to test it.

The hard part of flush is a frame that has been accepted and has not left yet. The reference cannot show one: InMemoryLoom delivers before sendTo returns, so a suite running against it passes whether or not flush waits for anything. So the properties that matter need a harness that can stop a send partway, and this says which harnesses can.

No arm is taken on trust. SeamConformanceSuite.flushDeclarationIsHonest asks the seam, and each arm has to agree with the answer.

Inheritors

Types

Link copied to clipboard
data class CannotHold(val reason: String) : FlushFixture

This fabric confirms a drain, and the harness cannot stop a send partway.

Link copied to clipboard
class Holdable(val host: SendHold, val joiner: SendHold) : FlushFixture

This fabric confirms a drain, and the harness can stop a send where the transport would.

Link copied to clipboard
data class HostUnsupported(val trackingUrl: String) : FlushFixture

A role-split harness whose host seam answers FlushOutcome.Unsupported, while its joiner is a different seam that confirms a drain. A hub and its spokes have this shape: the members of a tiered union are not themselves tiered.

Link copied to clipboard
data class JoinerUnsupported(val reason: String) : FlushFixture

A role-split harness whose joiner answers FlushOutcome.Unsupported, while its host confirms a drain. A WebSocket server and an OkHttp client have this shape: the client's engine drops a frame past its own queue without saying so.

Link copied to clipboard
data class Unsupported(val trackingUrl: String) : FlushFixture

This fabric answers FlushOutcome.Unsupported: it cannot confirm a drain yet, and says so.