Cooperative cancel for in-process jobs.
The token is polled before each job and before each in-process
dispatch. A force-call inside a compiled relax still runs to the next
poll. cancel_state sets the flag only while a batch is running,
and the flag is cleared when that batch returns.
Module Contents
API
-
exception eon.cancel.Cancelled[source]
Bases: Exception
Raised when a job sees a cancelled token.
Initialization
Initialize self. See help(type(self)) for accurate signature.
-
class eon.cancel.CancelToken[source]
Initialization
-
cancel() → None[source]
-
reset() → None[source]
-
property cancelled: bool
-
raise_if_cancelled() → None[source]