Skip to main content

REQUEST_CT

Static REQUEST_CT 

Source
pub static REQUEST_CT: LocalKey<CancellationToken>
Expand description

#1781: the cancellation token of the request currently being served, scoped by call_tool around the whole guarded dispatch.

A task-local rather than a field on the shared server: rmcp spawns one task per request and hands each its own child_token, so concurrent calls would otherwise overwrite one another’s token — and cancelling the wrong command is worse than not cancelling at all.