CloseResult
What closeAndAwait can tell the caller about a shutdown. A final class the library alone produces (ADR 0001 §2a): properties may be added in a minor version, and the set of outcomes is not an enum that could grow under a caller's when.
Network delivery is out of scope. Nothing here says an event reached a server, or even that the transport sent it: only that the tracker handed it over. What the transport then does with it — its queue, its retries — is its business, and the one thing the tracker asks of it is Transport.flush.
What "handed over" means depends on who stamps:
The core stamps (the default): the tracker waits until every accepted event has been stamped and its call into the transport has returned.
The transport stamps in its own pipeline (Segment on Android): the tracker waits for the calls into the transport to return. It does not wait for the pipeline's own queue or stamping, and cannot; the flush it requests afterwards is how that queue is nudged.
The result separates four facts, because a single "success" flag would hide one of them:
cutoffReached: the tracker stopped accepting work. False only when the tracker cannot do that through this path, in which case nothing else was done (isUnsupported).
waitCompleted: everything accepted before the cutoff was handed over within the time allowed. False is timedOut: some accepted work may not have reached the transport.
failedHandOffs: how many calls into the transport (or the stamping in front of it) threw. The tracker swallows these so analytics never crashes the app, and logs them; a completed wait does not mean they all succeeded, which is why this count exists.
flushRequested and flushFailed: whether the tracker asked the transport to flush, and whether that call threw. A flush that returned means it was requested, not that anything was sent.
Everything here is a snapshot at the moment the result was produced. A call that timed out reports the state at its deadline, while the shutdown may still be running; a later closeAndAwait reports the final state. failedHandOffs counts failures over the tracker's whole life up to that moment, not only those of work accepted just before the close — nothing is accepted after the cutoff, so once waitCompleted it is the complete count.
Properties
Whether the tracker stopped accepting work. False means the tracker does not support this.
How many calls into the transport (or the stamping in front of it) threw. See the class docs.
Whether that Transport.flush threw.
Whether Transport.flush was called. Not called when a core-stamping drain was cut short.
True when the tracker does not offer an awaitable close — for example a scoped view of a tracker — so nothing was closed and nothing else in this result means anything.
Whether all work accepted before the cutoff was handed to the transport within the time allowed.