interruptHandler

abstract var interruptHandler: (notebook: NotebookDocument) -> PromiseLike<Void?>?(source)

Optional interrupt handler.

By default cell execution is canceled via tokens. Cancellation tokens require that a controller can keep track of its execution so that it can cancel a specific execution at a later point. Not all scenarios allow for that, eg. REPL-style controllers often work by interrupting whatever is currently running. For those cases the interrupt handler exists - it can be thought of as the equivalent of SIGINT or Control+C in terminals.

Note that supporting cancellation tokens is preferred and that interrupt handlers should only be used when tokens cannot be supported.

Online Documentation