on_cancel
Source and package
- Module
- LibTmux
- Package
- LibTmux
- Source
- src/process.jl
-
Methods#
Register a callable and return a
CancellationSubscription.cancel!invokes each registered callback once, outside the token lock, on its calling task. If already cancelled, invokef()before returning. Keep callbacks prompt: signal an event or stop an owned process; do not wait for operation completion. Callback failures are collected after all callbacks run and raised together.on_cancel(f, token::CancellationToken)Closing a subscription prevents later invocation and joins a callback already running on another task. Close subscriptions when their operation retires.