Class: AWS::Flow::Core::AsyncEventLoop Private

Inherits:
Object
  • Object
show all
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

Constructor Details

#initializeAsyncEventLoop

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

#executeQueuedTasksObject

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

#remove(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.



183
184
185
# File 'lib/aws/flow/async_scope.rb', line 183

def remove(task)
  @tasks.delete(task)
end