13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/event_source/event_store/http/write.rb', line 13
def write(batch, stream_name, expected_version: nil)
logger.trace { "Writing batch (Stream Name: #{stream_name}, Number of Events: #{batch.count}, Expected Version: #{expected_version.inspect})" }
position = put.(batch, stream_name, expected_version: expected_version)
last_position = position + (batch.count - 1)
logger.debug { "Wrote batch (Stream Name: #{stream_name}, Number of Events: #{batch.count}, Expected Version: #{expected_version.inspect}, Last Position: #{last_position})" }
last_position
end
|