function Token.cancel
Cancel this token and every token derived from it, and wake every
wait(). Every process bound to one of them starts its stop sequence. Cancelling ctx.cancellation.root ends the task as Ctrl+C would.
function Token.child
A token cancelled whenever this one is. Cancelling the child never affects this token. Bind a piece of work to a child to be able to stop just that piece:
sub = ctx.cancellation.root.child().
function Token.wait
Block until this token is cancelled, or
timeout_ms passes. Returns True when it was cancelled, False on the timeout.
property Token.cancelled
Whether this token has been cancelled, by
cancel() on it or on an ancestor, or by the operating system for the root. What a loop checks on its tick.
