class Later
Used to defer cancelling the current task until later.
Definitions
def initialize(task, cause = nil)
Create a new cancel later operation.
Signature
-
parameter
taskTask The task to cancel later.
-
parameter
causeException The cause of the cancel operation.
Implementation
def initialize(task, cause = nil)
@task = task
@cause = cause
end
def alive?
Signature
-
returns
Boolean Whether the task is alive.
Implementation
def alive?
true
end
def transfer
Transfer control to the operation - this will cancel the task.
Implementation
def transfer
@task.cancel(false, cause: @cause)
end