Class: Euston::Daemons::Pipeline::MessageBuffer::Component

Inherits:
Euston::DaemonComponent show all
Extended by:
RabbitMq::Exchanges
Defined in:
lib/euston-daemons/pipeline/lib/message_buffer/component.rb

Instance Method Summary collapse

Methods inherited from Euston::DaemonComponent

#run, #stop

Methods included from Exceptions

#ignorable_exception?

Constructor Details

#initialize(channel, id = 1, logger = Euston::NullLogger.instance) ⇒ Component

Returns a new instance of Component.



8
9
10
11
12
13
14
15
16
# File 'lib/euston-daemons/pipeline/lib/message_buffer/component.rb', line 8

def initialize channel, id = 1, logger = Euston::NullLogger.instance
  @channel = channel
  @channel.prefetch = 1
  @channel.tx_select
  @id = "message_buffer #{id}"
  @log = logger
  @buffer = Buffer.new DaemonEnvironment.event_store_mongodb
  @stopwatch = Stopwatch.new.when(:finished => method(:log_elapsed_time))
end