doSynchronously

fun <T> CoroutineScope.doSynchronously(block: suspend CoroutineScope.() -> T): T(source)

Alias for launchSynchronously. Launches a coroutine and blocks the current thread until it completes.

Return

The result of the suspending block

Parameters

block

The suspending function to execute synchronously

Type Parameters

T

The return type of the suspending block


fun <T> doSynchronously(block: suspend CoroutineScope.() -> T): T(source)

Alias for launchSynchronously. Launches a coroutine in a new scope and blocks the current thread until it completes.

Return

The result of the suspending block

Parameters

block

The suspending function to execute synchronously

Type Parameters

T

The return type of the suspending block