Brain Docs

Reference

TypeScript SDKInstallationHTTP clientWire client
subscribecancelStream
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
TypeScript SDKStreamscancelStream

cancelStream

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
cancelStream(targetStreamId: number, reason?: CancellationReason): Promise<CancelStreamAck>

Parameters

ParameterTypeRequired
targetStreamIdintegerrequired

The stream to cancel.

reasonCancellationReasonoptional

Defaults to ClientUnneeded.

Returns

FieldTypePresence
targetStreamIdintegeralways

Echoed back.

cancelledAtUnixNanos64-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.

txnBegin

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

On this page

ParametersReturns
Suggest an editOpen in Playground