elizarov
val ready = CompletableDeferred<Unit>() // do ready.complete(Unit) when you receive "ready" callback suspend fun doSmth() = ready.await()