Class: RFlow::Components::Replicate
- Inherits:
-
RFlow::Component
- Object
- RFlow::Component
- RFlow::Components::Replicate
- Defined in:
- lib/rflow/components/replicate.rb
Overview
A component that replicates all inbound messages onto a single out port in order to easily support a many-to-many connection pattern (connect all the ins to this component and all the outs to this component instead of all of the ins to all of the outs).
Emits Messages of whatever type was sent in. Any messages with problems being sent to #out will be sent to #errored instead.
Instance Attribute Summary collapse
-
#errored ⇒ Component::OutputPort
readonly
Outputs Messagess that could not be sent to #errored.
-
#in ⇒ Component::InputPort
readonly
Receives Messages.
-
#out ⇒ Component::OutputPort
readonly
Outputs Messages.
Attributes inherited from RFlow::Component
#name, #ports, #shard, #uuid, #worker
Instance Method Summary collapse
-
#process_message(input_port, input_port_key, connection, message) ⇒ void
RFlow-called method on message arrival.
Methods inherited from RFlow::Component
build, #cleanup!, #configure!, #initialize, input_port, #input_ports, output_port, #output_ports, #run!, #shutdown!, #to_s
Constructor Details
This class inherits a constructor from RFlow::Component
Instance Attribute Details
#errored ⇒ Component::OutputPort (readonly)
Outputs Messagess that could not be sent to #errored.
23 |
# File 'lib/rflow/components/replicate.rb', line 23 output_port :errored |
#in ⇒ Component::InputPort (readonly)
Receives Messages.
15 |
# File 'lib/rflow/components/replicate.rb', line 15 input_port :in |
#out ⇒ Component::OutputPort (readonly)
Outputs Messages.
19 |
# File 'lib/rflow/components/replicate.rb', line 19 output_port :out |
Instance Method Details
#process_message(input_port, input_port_key, connection, message) ⇒ void
This method returns an undefined value.
RFlow-called method on message arrival.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/rflow/components/replicate.rb', line 27 def (input_port, input_port_key, connection, ) out.each do |connections| begin connections. rescue Exception => e RFlow.logger.debug "#{self.class} Message caused exception: #{e.class}: #{e.}: #{e.backtrace}" errored. end end end |