If you have a multipart transaction that can be aborted in one phase but not another then the AllowCancel signal can be sent. This allows for example the hif download to be cancelled, but not the install transaction. By cancelling a job all subtransactions are killed.
By default actions cannot be cancelled unless enabled in the backend.
Use AllowCancel(true)
to enable cancellation
and AllowCancel(false)
to disable it.
This can be done for any job type.
For compiled backends that are threaded, the
cancel()
method can be used to terminate
the thread.
For spawned backends, there are two staggered signals send to allow locks to be released or for the backend to clean up after itself:
Send the process SIGQUIT
.
Wait 500ms
If the process has not already quit, send the process
SIGKILL
to terminate it.