Class: AWS::Flow::Core::AsyncEventLoop Private
- Inherits:
-
Object
- Object
- AWS::Flow::Core::AsyncEventLoop
- Defined in:
- lib/aws/flow/async_scope.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #<<(task) ⇒ Object private
-
#executeQueuedTasks ⇒ Object
private
Actually executes the eventLoop.
-
#fail(task, error) ⇒ Object
private
TODO Make sure that it’s okay to fail from the AsyncEventLoop, and that this is the correct behavior.
-
#initialize ⇒ AsyncEventLoop
constructor
private
A new instance of AsyncEventLoop.
- #remove(task) ⇒ Object private
Constructor Details
#initialize ⇒ AsyncEventLoop
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of AsyncEventLoop.
178 179 180 |
# File 'lib/aws/flow/async_scope.rb', line 178 def initialize @tasks = [] end |
Instance Method Details
#<<(task) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
193 194 195 196 |
# File 'lib/aws/flow/async_scope.rb', line 193 def <<(task) @tasks << task end |
#executeQueuedTasks ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Actually executes the eventLoop.
202 203 204 205 206 207 |
# File 'lib/aws/flow/async_scope.rb', line 202 def executeQueuedTasks until @tasks.empty? task = @tasks.shift task.resume if task.alive? end end |
#fail(task, error) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
TODO Make sure that it’s okay to fail from the AsyncEventLoop, and that this is the correct behavior.
188 189 190 |
# File 'lib/aws/flow/async_scope.rb', line 188 def fail(task, error) raise error end |