Class: AWS::Flow::Core::BeginRescueEnsureWrapper Private
- Defined in:
- lib/aws/flow/begin_rescue_ensure.rb
Overview
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.
Ensures that BeginRescueEnsure isn’t exposed directly. This function is passed in when #error_handler is called, like this:
error_handler do |t|
t.begin { "This is the begin" }
t.rescue(Exception) { "This is the rescue" }
t.ensure { trace << t.begin_task }
end
In this example, t is a BeginRescueEnsureWrapper which passes the begin/rescue/ensure calls to the BeginRescueEnsure class itself.
Instance Attribute Summary collapse
-
#__context__ ⇒ Object
readonly
private
Also has a few methods to ensure fiber-ness, such as get_heirs and cancel.
Instance Method Summary collapse
-
#begin(&block) ⇒ Object
private
Binds the block to a lambda to be called when we get to the begin part of the data flow analysis.
- #cancel(error_type) ⇒ Object private
-
#ensure(&block) ⇒ Object
private
Binds the block to a lambda to be called when we get to the ensure part of the data flow analysis.
-
#get_closest_containing_scope ⇒ Object
private
Gets the parent of the BeginRescueEnsure instance held by this class.
- #get_heirs ⇒ Object private
-
#initialize(block, begin_rescue_ensure) ⇒ BeginRescueEnsureWrapper
constructor
private
Creates a new ‘BeginRescueEnsureWrapper` instance.
- #is_daemon? ⇒ Boolean private
-
#rescue(*error_types, &block) ⇒ Object
private
Binds the block to a lambda to be called when we get to the rescue part of the DFA.
Methods inherited from FlowFiber
#[], [], []=, #[]=, finalize, unset
Constructor Details
#initialize(block, begin_rescue_ensure) ⇒ BeginRescueEnsureWrapper
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.
Creates a new ‘BeginRescueEnsureWrapper` instance.
332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/aws/flow/begin_rescue_ensure.rb', line 332 def initialize(block, begin_rescue_ensure) @beginRescueEnsure = begin_rescue_ensure @__context__ = @beginRescueEnsure super() do begin block.call(self) ensure @__context__.parent.remove(self) end end end |
Instance Attribute Details
#__context__ ⇒ Object (readonly)
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.
Also has a few methods to ensure fiber-ness, such as get_heirs and cancel.
321 322 323 |
# File 'lib/aws/flow/begin_rescue_ensure.rb', line 321 def __context__ @__context__ end |
Instance Method Details
#begin(&block) ⇒ 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.
Binds the block to a lambda to be called when we get to the begin part of the data flow analysis.
368 |
# File 'lib/aws/flow/begin_rescue_ensure.rb', line 368 def begin(&block) @beginRescueEnsure.begin(block) end |
#cancel(error_type) ⇒ 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.
352 353 354 |
# File 'lib/aws/flow/begin_rescue_ensure.rb', line 352 def cancel(error_type) @beginRescueEnsure.parent.cancel(self) end |
#ensure(&block) ⇒ 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.
Binds the block to a lambda to be called when we get to the ensure part of the data flow analysis.
371 |
# File 'lib/aws/flow/begin_rescue_ensure.rb', line 371 def ensure(&block) @beginRescueEnsure.ensure(block) 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.
Gets the parent of the AWS::Flow::Core::BeginRescueEnsure instance held by this class.
363 364 365 |
# File 'lib/aws/flow/begin_rescue_ensure.rb', line 363 def get_closest_containing_scope @beginRescueEnsure.parent end |
#get_heirs ⇒ 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.
346 347 348 349 |
# File 'lib/aws/flow/begin_rescue_ensure.rb', line 346 def get_heirs p "I am a BREWrapper" return end |
#is_daemon? ⇒ Boolean
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.
357 358 359 |
# File 'lib/aws/flow/begin_rescue_ensure.rb', line 357 def is_daemon? false end |
#rescue(*error_types, &block) ⇒ 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.
Binds the block to a lambda to be called when we get to the rescue part of the DFA
374 375 376 |
# File 'lib/aws/flow/begin_rescue_ensure.rb', line 374 def rescue(*error_types, &block) @beginRescueEnsure.rescue(error_types, block) end |