Class: EmPipelines::BatchEventSource
- Inherits:
-
EventSource
- Object
- EventSource
- EmPipelines::BatchEventSource
- Defined in:
- lib/empipelines/batch_event_source.rb
Instance Method Summary collapse
-
#initialize(em, list_name, events) ⇒ BatchEventSource
constructor
A new instance of BatchEventSource.
- #start! ⇒ Object
Methods inherited from EventSource
Constructor Details
#initialize(em, list_name, events) ⇒ BatchEventSource
Returns a new instance of BatchEventSource.
7 8 9 10 |
# File 'lib/empipelines/batch_event_source.rb', line 7 def initialize(em, list_name, events) @num_finalised = 0 @em, @list_name, @events = em, list_name,events end |
Instance Method Details
#start! ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/empipelines/batch_event_source.rb', line 12 def start! @finalised = [] check_if_finished = lambda do |m| @num_finalised += 1 check_if_finished end @events.each do |e| = Message.new({ :payload => e, :origin => @list_name }) .on_broken() .on_rejected() .on_consumed() event!() end end |