Brain Docs

Reference

Rust SDKInstallationHTTP clientWire client
subscribecancel_stream
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
Rust SDKStreamscancel_stream

cancel_stream

Stop an in-flight multiplexed stream server-side — abandoning the call does not.

PURPOSE

Cancel any in-flight multiplexed stream — not just a subscription. A long enumeration or traversal whose answer is no longer needed is what this is for: cancelling stops the server computing, where abandoning the call does not.

Handshake credentialstable
async fn cancel_stream(&self, target_stream_id: u32, reason: CancellationReason) -> Result<CancelStreamAck>

Parameters

ParameterTypeRequired
target_stream_idintegerrequired

The stream to cancel.

reasonCancellationReasonoptional

Defaults to ClientUnneeded.

Returns

FieldTypePresence
target_stream_idintegeralways

Echoed back.

cancelled_at_unix_nanos64-bit integeralways

When the server stopped.

Wire tier only

There is no HTTP equivalent: an HTTP response has no stream id to name, and closing the response body is the whole cancellation story there.

See also
subscribePagination

Was this page helpful?

subscribe

Open a live feed of what is landing in a space, and resume it exactly by log position.

txn_begin

Open a transaction with an id you generate, and a timeout the server may lower.

On this page

ParametersReturns
Suggest an editOpen in Playground