runBlocking

expect fun <T> runBlocking(context: CoroutineContext, block: suspend CoroutineScope.() -> T): T

Execute a blocking coroutine on the current platform.

Platform implementations:

  • JVM/Native: Uses kotlinx.coroutines.runBlocking for true blocking behavior

  • JS: Uses GlobalScope.promise with a warning (true blocking not supported)

Return

The result of the suspend block

Parameters

context

The coroutine context to use

block

The suspend block to execute

actual fun <T> runBlocking(context: CoroutineContext, block: suspend CoroutineScope.() -> T): T
actual fun <T> runBlocking(context: CoroutineContext, block: suspend CoroutineScope.() -> T): T
actual fun <T> runBlocking(context: CoroutineContext, block: suspend CoroutineScope.() -> T): T