Skip to content

Commit 2564866

Browse files
Fix ktdocs for select and awaitAll (#494)
1 parent 5962c20 commit 2564866

File tree

1 file changed

+6
-11
lines changed
  • sdk-api-kotlin/src/main/kotlin/dev/restate/sdk/kotlin

1 file changed

+6
-11
lines changed

sdk-api-kotlin/src/main/kotlin/dev/restate/sdk/kotlin/api.kt

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -530,24 +530,19 @@ sealed interface DurableFuture<T> {
530530
* Like [kotlinx.coroutines.awaitAll], but for [DurableFuture].
531531
*
532532
* ```
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>()
536535
*
537536
* val result = listOf(a1, a2)
538537
* .awaitAll()
539-
* .joinToString(separator = "-", transform = GreetingResponse::getMessage)
538+
* .joinToString(separator = "-")
540539
* ```
541540
*/
542541
suspend fun <T> Collection<DurableFuture<T>>.awaitAll(): List<T> {
543542
return awaitAll(*toTypedArray())
544543
}
545544

546-
/**
547-
* Like [kotlinx.coroutines.awaitAll], but for [DurableFuture].
548-
*
549-
* ```
550-
*/
545+
/** @see Collection.awaitAll */
551546
suspend fun <T> awaitAll(vararg durableFutures: DurableFuture<T>): List<T> {
552547
if (durableFutures.isEmpty()) {
553548
return emptyList()
@@ -563,9 +558,9 @@ suspend fun <T> awaitAll(vararg durableFutures: DurableFuture<T>): List<T> {
563558
* Like [kotlinx.coroutines.selects.select], but for [DurableFuture]
564559
*
565560
* ```
566-
* val ctx = restateContext()
567-
* val callFuture = ctx.callAsync(GreeterGrpcKt.greetMethod, greetingRequest { name = "Francesco" })
561+
* val callFuture = ctx.awakeable()
568562
* val timeout = ctx.timer(10.seconds)
563+
*
569564
* val result = select {
570565
* callFuture.onAwait { it.message }
571566
* timeout.onAwait { throw TimeoutException() }

0 commit comments

Comments
 (0)