SendHold

interface SendHold

A test's grip on the point where a transport's send would block: hold it, count what is stuck there, and let it go one frame at a time.

This exists for what an in-memory fabric cannot show. InMemoryLoom delivers before sendTo returns, so "the frame was accepted but has not left yet" never happens on it, and a test of flush over it passes whether or not anything waited.

Inheritors

Properties

Link copied to clipboard
abstract val parkedSends: Int

How many sends are stuck at the hold right now. A test asserts this before anything else: a hold nothing reached makes "the flush waited" pass by absence.

Functions

Link copied to clipboard
abstract fun hold()

From now on, every send stops at the hold until it is released. Sends already past it finish.

Link copied to clipboard
abstract fun releaseAll()

Stop holding: everything held goes through, and so does everything after it.

Link copied to clipboard
abstract fun releaseOne()

Let the oldest held send through, or the next one to arrive if none is held yet.