@@ -530,24 +530,19 @@ sealed interface DurableFuture<T> {
530
530
* Like [kotlinx.coroutines.awaitAll], but for [DurableFuture].
531
531
*
532
532
* ```
533
- * val ctx = restateContext()
534
- * val a1 = ctx.callAsync(GreeterGrpcKt.greetMethod, greetingRequest { name = "Francesco" })
535
- * val a2 = ctx.callAsync(GreeterGrpcKt.greetMethod, greetingRequest { name = "Till" })
533
+ * val a1 = ctx.awakeable<String>()
534
+ * val a2 = ctx.awakeable<String>()
536
535
*
537
536
* val result = listOf(a1, a2)
538
537
* .awaitAll()
539
- * .joinToString(separator = "-", transform = GreetingResponse::getMessage )
538
+ * .joinToString(separator = "-")
540
539
* ```
541
540
*/
542
541
suspend fun <T > Collection<DurableFuture<T>>.awaitAll (): List <T > {
543
542
return awaitAll(* toTypedArray())
544
543
}
545
544
546
- /* *
547
- * Like [kotlinx.coroutines.awaitAll], but for [DurableFuture].
548
- *
549
- * ```
550
- */
545
+ /* * @see Collection.awaitAll */
551
546
suspend fun <T > awaitAll (vararg durableFutures : DurableFuture <T >): List <T > {
552
547
if (durableFutures.isEmpty()) {
553
548
return emptyList()
@@ -563,9 +558,9 @@ suspend fun <T> awaitAll(vararg durableFutures: DurableFuture<T>): List<T> {
563
558
* Like [kotlinx.coroutines.selects.select], but for [DurableFuture]
564
559
*
565
560
* ```
566
- * val ctx = restateContext()
567
- * val callFuture = ctx.callAsync(GreeterGrpcKt.greetMethod, greetingRequest { name = "Francesco" })
561
+ * val callFuture = ctx.awakeable()
568
562
* val timeout = ctx.timer(10.seconds)
563
+ *
569
564
* val result = select {
570
565
* callFuture.onAwait { it.message }
571
566
* timeout.onAwait { throw TimeoutException() }
0 commit comments