Skip to content

Commit 506ec3f

Browse files
committed
docs: clarify automatic request cancellation behavior
1 parent 25bea00 commit 506ec3f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

md/request-cancellation.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ The `SentRequest` remembers the peer and any proxy wrapping used for the
2828
original request, so this also works for requests sent through
2929
`ConnectionTo::send_request_to`.
3030

31-
Dropping a `SentRequest` before a response is received also sends
32-
`$/cancel_request`. This covers abandoned request handles and futures: once a
33-
response is received by `block_task`, `on_receiving_result`, or
34-
`forward_response_to`, the SDK disarms the automatic cancellation.
31+
Dropping a `SentRequest` before the SDK receives a response also sends
32+
`$/cancel_request`. This covers abandoned request handles and futures. Once the
33+
SDK routes a response to the waiting request handle, automatic cancellation is
34+
disarmed, even if caller code has not yet consumed it with `block_task`,
35+
`on_receiving_result`, or `forward_response_to`.
3536

3637
If you already have the JSON-RPC request ID, send the notification directly:
3738

0 commit comments

Comments
 (0)