Class: AWS::Flow::Core::RootAsyncScope Private
- 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 Attribute Summary collapse
- #backtrace ⇒ Object private
- #complete ⇒ Object private
- #executor ⇒ Object private
- #failure ⇒ Object private
Instance Method Summary collapse
- #<<(this_task) ⇒ Object private
-
#eventLoop ⇒ Object
private
Call out to the AsyncEventLoop.
-
#fail(task, error) ⇒ Object
private
As with remove, the only thing that is under RootAsyncScope should be the root BeginRescueEnsure, so upon failure we will be complete.
-
#get_closest_containing_scope ⇒ Object
private
Return self, a RootAsyncScope is the closest containing scope.
-
#initialize(options = {}, &block) ⇒ RootAsyncScope
constructor
private
A new instance of RootAsyncScope.
-
#remove(task) ⇒ Object
private
The only thing that should be removed from the RootAsyncScope is the root BeginRescueEnsure, so upon removal we are complete.
Methods inherited from FlowFiber
#[], [], []=, #[]=, finalize, unset
Constructor Details
#initialize(options = {}, &block) ⇒ RootAsyncScope
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 RootAsyncScope.
117 118 119 120 121 122 123 124 125 |
# File 'lib/aws/flow/async_scope.rb', line 117 def initialize( = {}, &block) @parent = [:parent_context] @daemon = [:daemon] @context = @parent @executor = AsyncEventLoop.new @task_queue = [] @complete = false @task_queue << Task.new(context, &block) if block end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object (private)
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.
165 166 167 168 169 170 171 |
# 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 |
Instance Attribute Details
#backtrace ⇒ 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.
114 115 116 |
# File 'lib/aws/flow/async_scope.rb', line 114 def backtrace @backtrace end |
#complete ⇒ 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.
114 115 116 |
# File 'lib/aws/flow/async_scope.rb', line 114 def complete @complete end |
#executor ⇒ 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.
114 115 116 |
# File 'lib/aws/flow/async_scope.rb', line 114 def executor @executor end |
#failure ⇒ 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.
114 115 116 |
# File 'lib/aws/flow/async_scope.rb', line 114 def failure @failure end |
Instance Method Details
#<<(this_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.
144 145 146 |
# File 'lib/aws/flow/async_scope.rb', line 144 def <<(this_task) @executor << this_task end |
#eventLoop ⇒ 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.
Call out to the AsyncEventLoop.
156 157 158 |
# File 'lib/aws/flow/async_scope.rb', line 156 def eventLoop @executor.executeQueuedTasks 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.
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.
138 139 140 141 |
# File 'lib/aws/flow/async_scope.rb', line 138 def fail(task, error) @failure = error @complete = true end |
#get_closest_containing_scope ⇒ 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.
Return self, a RootAsyncScope is the closest containing scope.
150 151 152 |
# File 'lib/aws/flow/async_scope.rb', line 150 def get_closest_containing_scope self 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.
The only thing that should be removed from the RootAsyncScope is the root BeginRescueEnsure, so upon removal we are complete.
130 131 132 |
# File 'lib/aws/flow/async_scope.rb', line 130 def remove(task) @complete = true end |