Skip to main content

current_token

Function current_token 

Source
pub fn current_token() -> Option<CancelToken>
Expand description

Token of the request or task currently executing on this thread.

Inside a host function called from Lua code that an isle runs, this is the token of that request (for coroutine requests and tasks, the one being polled). Use it to derive a child_token for work the host function starts, so that cancelling the request reaches that work too. Returns None outside such a context.