Class: FlowNodes::AsyncNode

Inherits:
Node show all
Defined in:
lib/flow_nodes/async_node.rb

Overview

A node designed for asynchronous execution.

Direct Known Subclasses

AsyncBatchNode, AsyncParallelBatchNode

Instance Attribute Summary

Attributes inherited from Node

#current_retry, #max_retries, #wait

Attributes inherited from BaseNode

#params, #successors

Instance Method Summary collapse

Methods inherited from Node

#initialize

Methods inherited from BaseNode

#-, #>>, #exec, #initialize, #initialize_copy, #nxt, #run, #set_params

Constructor Details

This class inherits a constructor from FlowNodes::Node

Instance Method Details

#_run(_s) ⇒ Object



12
13
14
# File 'lib/flow_nodes/async_node.rb', line 12

def _run(_s)
  raise "Use run_async for AsyncNode."
end

#run_async(s) ⇒ Object

Runs the node asynchronously. Use with ‘AsyncFlow` to chain successors.



7
8
9
10
# File 'lib/flow_nodes/async_node.rb', line 7

def run_async(s)
  warn("Node won't run successors. Use AsyncFlow.") unless @successors.empty?
  _run_async(s)
end