WaitMonitor.add_cancel_callback()
Each callbacks is called only once before the operation is cancelled. Callback function should accept no parameters.