Class: RFlow::Components::RubyProcFilter
- Inherits:
-
RFlow::Component
- Object
- RFlow::Component
- RFlow::Components::RubyProcFilter
- Defined in:
- lib/rflow/components/ruby_proc_filter.rb
Instance Attribute Summary
Attributes inherited from RFlow::Component
Instance Method Summary collapse
- #configure!(config) ⇒ Object
- #process_message(input_port, input_port_key, connection, message) ⇒ Object
Methods inherited from RFlow::Component
build, #cleanup!, #configure_input_port!, #configure_output_port!, #connect_inputs!, #connect_outputs!, define_port, defined_input_ports, defined_output_ports, inherited, #initialize, input_port, #input_ports, output_port, #output_ports, #run!, #shard, #shutdown!, #to_s
Constructor Details
This class inherits a constructor from RFlow::Component
Instance Method Details
permalink #configure!(config) ⇒ Object
[View source]
9 10 11 |
# File 'lib/rflow/components/ruby_proc_filter.rb', line 9 def configure!(config) @filter_proc = eval("lambda {|message| #{config['filter_proc_string']} }") end |
permalink #process_message(input_port, input_port_key, connection, message) ⇒ Object
[View source]
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rflow/components/ruby_proc_filter.rb', line 13 def (input_port, input_port_key, connection, ) begin if @filter_proc.call() filtered. else dropped. end rescue Exception => e RFlow.logger.debug "#{self.class} Message caused exception: #{e.class}: #{e.}: #{e.backtrace}" errored. end end |