Class: Smith::Workflow::Parallel::NestedExecution
- Inherits:
-
Object
- Object
- Smith::Workflow::Parallel::NestedExecution
- Extended by:
- Dry::Initializer
- Defined in:
- lib/smith/workflow/parallel/nested_execution.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize ⇒ NestedExecution
constructor
A new instance of NestedExecution.
Constructor Details
#initialize ⇒ NestedExecution
Returns a new instance of NestedExecution.
15 16 17 18 |
# File 'lib/smith/workflow/parallel/nested_execution.rb', line 15 def initialize(...) super @depth = context.next_nesting_depth! end |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/smith/workflow/parallel/nested_execution.rb', line 20 def call Thread.handle_interrupt(Object => :never) do prepare Thread.handle_interrupt(Object => :immediate) { execute } rescue Exception => e # rubocop:disable Lint/RescueException context.signal.cancel!(e) raise ensure drain_futures release_workers end end |