Class: Async::Stop::Later

Inherits:
Object
  • Object
show all
Defined in:
lib/async/task.rb

Overview

Used to defer stopping the current task until later.

Instance Method Summary collapse

Constructor Details

#initialize(task) ⇒ Later

Create a new stop later operation.



26
27
28
# File 'lib/async/task.rb', line 26

def initialize(task)
	@task = task
end

Instance Method Details

#alive?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/async/task.rb', line 31

def alive?
	true
end

#transferObject

Transfer control to the operation - this will stop the task.



36
37
38
# File 'lib/async/task.rb', line 36

def transfer
	@task.stop
end