class AWS::Flow::Core::RootAsyncScope
@api private
Constants
- DELEGATED_METHODS
Attributes
backtrace[RW]
complete[RW]
executor[RW]
failure[RW]
Public Class Methods
new(options = {}, &block)
click to toggle source
@api private
# File lib/aws/flow/async_scope.rb, line 117 def initialize(options = {}, &block) @parent = options[:parent_context] @daemon = options[:daemon] @context = @parent @executor = AsyncEventLoop.new @task_queue = [] @complete = false @task_queue << Task.new(context, &block) if block end
Public Instance Methods
<<(this_task)
click to toggle source
@api private
# File lib/aws/flow/async_scope.rb, line 144 def <<(this_task) @executor << this_task end
eventLoop()
click to toggle source
Call out to the AsyncEventLoop
. @api private
# File lib/aws/flow/async_scope.rb, line 156 def eventLoop @executor.executeQueuedTasks end
fail(task, error)
click to toggle source
As with remove, the only thing that is under RootAsyncScope
should be the root BeginRescueEnsure
, so upon failure we will be complete. Also sets failure variable for later raising. @api private
# File lib/aws/flow/async_scope.rb, line 138 def fail(task, error) @failure = error @complete = true end
get_closest_containing_scope()
click to toggle source
Return self, a RootAsyncScope
is the closest containing scope. @api private
# File lib/aws/flow/async_scope.rb, line 150 def get_closest_containing_scope self end
remove(task)
click to toggle source
The only thing that should be removed from the RootAsyncScope
is the root BeginRescueEnsure
, so upon removal we are complete. @api private
# File lib/aws/flow/async_scope.rb, line 130 def remove(task) @complete = true end
Private Instance Methods
method_missing(method_name, *args)
click to toggle source
@api private
Calls superclass method
# File lib/aws/flow/async_scope.rb, line 165 def method_missing(method_name, *args) if DELEGATED_METHODS.include? method_name @executor.send(method_name, *args) else super end end