onEvent
A callback that is invoked when an event is emitted.
This method is called synchronously on the SDK's calling coroutine. The SDK may read mutable event properties immediately after this method returns, so any customizations must be applied before returning.
Implementations must be fast and non-blocking. Because this is not a
suspendfunction, any blocking I/O (network, disk, locks) will block the calling coroutine's thread. Handlers are intended for lightweight configuration — setting a flag or changing a value.
Note: the specific thread or dispatcher this runs on is not guaranteed.
Parameters
event
the event being emitted.