Skip to content

Commit

Permalink
fix cancel example
Browse files Browse the repository at this point in the history
  • Loading branch information
pkwarren committed Oct 20, 2023
1 parent 0ee1d44 commit 1297832
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/kotlin/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ With the callback unary signature, the result is a canceling handler
to give control to the user to manually cancel a request:

```kotlin
val request = SayRequest(sentence = sentence)
val cancelable = elizaClient.say(request) { response in
print(response.code) // Code.canceled.
val request = sayRequest { sentence = sentence }
val cancel = elizaServiceClient.say(request) { response ->
print(response.code) // Code.CANCELED.
}
cancelable.cancel()
cancel()
```

[connect-exception-source]: https://github.com/connectrpc/connect-kotlin/blob/main/library/src/main/kotlin/com/connectrpc/ConnectException.kt

0 comments on commit 1297832

Please sign in to comment.