AsyncSourceAsyncStopLater

class Later

Used to defer stopping the current task until later.

Definitions

def initialize(task, cause = nil)

Create a new stop later operation.

Signature

parameter task Task

The task to stop later.

parameter cause Exception

The cause of the stop 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 stop the task.

Implementation

def transfer
	@task.stop(false, cause: @cause)
end

Discussion