Class: Fluent::EventRouter::Pipeline
- Inherits:
-
Object
- Object
- Fluent::EventRouter::Pipeline
- Defined in:
- lib/fluent/event_router.rb
Instance Method Summary collapse
- #add_filter(filter) ⇒ Object
- #emit(tag, es, chain) ⇒ Object
-
#initialize ⇒ Pipeline
constructor
A new instance of Pipeline.
- #set_output(output) ⇒ Object
Constructor Details
#initialize ⇒ Pipeline
Returns a new instance of Pipeline.
136 137 138 139 |
# File 'lib/fluent/event_router.rb', line 136 def initialize @filters = [] @output = nil end |
Instance Method Details
#add_filter(filter) ⇒ Object
141 142 143 |
# File 'lib/fluent/event_router.rb', line 141 def add_filter(filter) @filters << filter end |
#emit(tag, es, chain) ⇒ Object
149 150 151 152 153 154 155 |
# File 'lib/fluent/event_router.rb', line 149 def emit(tag, es, chain) processed = es @filters.each { |filter| processed = filter.filter_stream(tag, processed) } @output.emit(tag, processed, chain) end |
#set_output(output) ⇒ Object
145 146 147 |
# File 'lib/fluent/event_router.rb', line 145 def set_output(output) @output = output end |