Method: Async::Node#terminate

Defined in:
lib/async/node.rb

#terminateObject

Immediately terminate all children tasks, including transient tasks. Internally invokes ‘stop(false)` on all children. This should be considered a last ditch effort and is used when closing the scheduler.



271
272
273
274
275
276
277
278
279
280
281
# File 'lib/async/node.rb', line 271

def terminate
  # Attempt to stop the current task immediately, and all children:
  stop(false)
  
  # If that doesn't work, take more serious action:
  @children&.each do |child|
    child.terminate
  end
  
  return @children.nil?
end