onInitialized

fun onInitialized(block: () -> Unit)(source)

Registers a callback to be invoked when the server has completed initialization.

The callback must be synchronous and fast: it runs on the message-dispatch path for notifications/initialized, after concurrent dispatch has been enabled for the session.

If initialization has already completed, block runs immediately on the calling thread. Otherwise it runs when notifications/initialized is received, after the callbacks registered before it. Each callback runs at most once.

An exception thrown by block is reported to onError instead of being propagated, so it does not prevent other callbacks from running.