Module: MessageStore::Postgres::Get::Call

Defined in:
lib/message_store/postgres/get.rb

Instance Method Summary collapse

Instance Method Details

#call(position) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/message_store/postgres/get.rb', line 48

def call(position)
  logger.trace(tag: :get) { "Getting message data (Stream Name: #{stream_name}, Position: #{position.inspect}, Batch Size: #{batch_size.inspect})" }

  position ||= Defaults.position

  result = get_result(stream_name, position)

  message_data = convert(result)

  logger.info(tag: :get) { "Finished getting message data (Count: #{message_data.length}, Stream Name: #{stream_name}, Position: #{position.inspect}, Batch Size: #{batch_size.inspect})" }
  logger.info(tags: [:data, :message_data]) { message_data.pretty_inspect }

  message_data
end