Class: Async::Stop::Later
- Inherits:
-
Object
- Object
- Async::Stop::Later
- Defined in:
- lib/async/stop.rb
Overview
Used to defer stopping the current task until later.
Instance Method Summary collapse
- #alive? ⇒ Boolean
-
#initialize(task, cause = nil) ⇒ Later
constructor
Create a new stop later operation.
-
#transfer ⇒ Object
Transfer control to the operation - this will stop the task.
Constructor Details
#initialize(task, cause = nil) ⇒ Later
Create a new stop later operation.
66 67 68 69 |
# File 'lib/async/stop.rb', line 66 def initialize(task, cause = nil) @task = task @cause = cause end |
Instance Method Details
#alive? ⇒ Boolean
72 73 74 |
# File 'lib/async/stop.rb', line 72 def alive? true end |
#transfer ⇒ Object
Transfer control to the operation - this will stop the task.
77 78 79 |
# File 'lib/async/stop.rb', line 77 def transfer @task.stop(false, cause: @cause) end |