Class: Fbp::Aggregator_node

Inherits:
Node
  • Object
show all
Defined in:
lib/fbp/aggregator-node.rb

Overview

Description

The Aggregator node puts itself into a transaction which will cause all of the incoming IPs to be aggregated until the upstream node has completed then the aggregated IPs will be sent on to the down stream node(s)

Instance Attribute Summary

Attributes inherited from Node

#executing, #options, #output

Instance Method Summary collapse

Methods inherited from Node

#clean_option, #execute, #is_ready_to_run?, #merge_options!, #register_for_output_from_node, #set_option, #stop, #unregister_for_output_from_node, #wait_until_completed, #write_to_input, #write_to_output

Constructor Details

#initializeAggregator_node

When a Aggregator_node is created, it is immediately put into a transaction. This allows the Aggregator_node to aggregate all of the IPs that come to it until the up stream node completes its work



14
15
16
17
# File 'lib/fbp/aggregator-node.rb', line 14

def initialize()
  super()
  write_to_input({:begin_transaction => true})
end

Instance Method Details

#do_node_work(args) ⇒ Object

Once the up stream node completes. The transaction will end and all of the IPs that had been accumulated during the transaction will be sent to the down stream node.



24
25
26
27
28
# File 'lib/fbp/aggregator-node.rb', line 24

def do_node_work(args)
  args.delete :completed
  write_to_output(args)
  false
end