5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/message_store/postgres/controls/put.rb', line 5
def self.call(instances: nil, stream_name: nil, message: nil, category: nil)
instances ||= 1
stream_name ||= StreamName.example(category: category)
message_specified = !message.nil?
message ||= MessageData::Write.example
position = nil
instances.times do
position = MessageStore::Postgres::Put.(message, stream_name)
unless message_specified
message.id = MessageData::Write.id
end
end
[stream_name, position]
end
|