awaitStarted

suspend fun awaitStarted()(source)

Suspends until the server has fully started and the port is bound.

Use this as a synchronization point when startSuspend is launched asynchronously. Returns immediately if the server is already started.

Example:

coroutineScope {
launch { mokksy.startSuspend() }
mokksy.awaitStarted() // port() and baseUrl() are safe after this point
}