invokeOnFirstOf

suspend fun <T, O> CoroutineScope.invokeOnFirstOf(cancelOnResult: Boolean = true, block: DoWithFirstBuilder<T>.() -> Unit, callback: suspend (T) -> O): O(source)