Class: MingleEvents::Processors::Pipeline

Inherits:
Object
  • Object
show all
Defined in:
lib/mingle_events/processors/pipeline.rb

Overview

Manages the passing of a stream of events through a sequence of processors

Instance Method Summary collapse

Constructor Details

#initialize(processors) ⇒ Pipeline

Returns a new instance of Pipeline.



7
8
9
# File 'lib/mingle_events/processors/pipeline.rb', line 7

def initialize(processors)
  @processors = processors
end

Instance Method Details

#process_events(events) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/mingle_events/processors/pipeline.rb', line 11

def process_events(events)
  processed_events = events
  @processors.each do |processor|
    processed_events = processor.process_events(processed_events)
  end
  processed_events
end