onEvent(listener: (event: Event) => void): () => void| Name | Type | Description |
|---|---|---|
listener* | (event: Event) => void |
Register a listener for every globally-unique event on the thread.
Fires exactly once per event_id across both the content pump
(user subscribe() calls) and the lifecycle watcher. Events
without an event_id always fire through (dedup is best-effort).
Returns an unsubscribe function. Primary consumer is
StreamController, which uses the listener to feed discovery
runners and pick up deeply-nested interrupts that the narrow
content pump wouldn't deliver.