Collecting

Accumulates emitted specs into a list for assertion in tests and headless host fixtures. Thread-safe — the underlying list is synchronised so substrate code that emits from background dispatchers can target this sink without coordinating its own marshalling.

Top-level nested (not inside the companion object) so the natural access path is NotificationSink.Collecting() rather than NotificationSink.Companion.Collecting().

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun clear()

Reset the collected history.

Link copied to clipboard
open override fun emit(spec: NotificationSpec)

Emit one notification. Must be safe to call from any thread — implementations marshal to whatever dispatcher they need.

Link copied to clipboard

Snapshot of the specs emitted so far.