MessageHandle

Tracks the lifecycle of a packet enqueued via RadioClient.send.

The state transitions through SendState values as the packet progresses from host queue to radio transmission to on-air delivery. Callers can observe state for reactive updates or suspend on await for a one-shot result.

Thread safety: state is a StateFlow — safe to observe from any coroutine. cancel is safe to call from any thread or coroutine.

Since

0.1.0

Properties

Link copied to clipboard

the unique identifier for this send (monotonically increasing within a session)

Link copied to clipboard
val state: StateFlow<SendState>

The current delivery state.

Functions

Link copied to clipboard
suspend fun await(): SendOutcome

Suspend until this send reaches a terminal state (Acked, Delivered, or Failed).

Link copied to clipboard
fun cancel()

Best-effort cancellation. Idempotent and non-suspending.

Link copied to clipboard

Re-enqueue the same packet that produced this MessageHandle. The engine assigns a fresh MessageId and returns a new handle, leaving the original handle's terminal state unchanged.