awaitAll

suspend fun <T> Collection<Awaitable<T>>.awaitAll(): List<T>

Like kotlinx.coroutines.awaitAll, but for Awaitable.


suspend fun <T> awaitAll(vararg awaitables: Awaitable<T>): List<T>

Like kotlinx.coroutines.awaitAll, but for Awaitable.

val ctx = restateContext()
val a1 = ctx.callAsync(GreeterGrpcKt.greetMethod, greetingRequest { name = "Francesco" })
val a2 = ctx.callAsync(GreeterGrpcKt.greetMethod, greetingRequest { name = "Till" })

val result = listOf(a1, a2)
.awaitAll()
.joinToString(separator = "-", transform = GreetingResponse::getMessage)