Sha256: bb7b9dbc4e78060efd3da267b1bd896855a610d360db0b0c1652fec6d18b2f59

Contents?: true

Size: 741 Bytes

Versions: 10

Compression:

Stored size: 741 Bytes

Contents

module MessageStore
  module Postgres
    module Controls
      module Put
        def self.call(instances: nil, stream_name: nil, message_data: nil, message: nil, category: nil)
          instances ||= 1
          stream_name ||= StreamName.example(category: category)
          message_data ||= message

          message_specified = !message_data.nil?

          message_data ||= MessageData::Write.example

          position = nil
          instances.times do
            position = MessageStore::Postgres::Put.(message_data, stream_name)

            unless message_specified
              message_data.id = MessageData::Write.id
            end
          end

          [stream_name, position]
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
evt-message_store-postgres-2.4.3.0 lib/message_store/postgres/controls/put.rb
evt-message_store-postgres-2.4.2.0 lib/message_store/postgres/controls/put.rb
evt-message_store-postgres-2.4.1.0 lib/message_store/postgres/controls/put.rb
evt-message_store-postgres-2.4.0.5 lib/message_store/postgres/controls/put.rb
evt-message_store-postgres-2.4.0.4 lib/message_store/postgres/controls/put.rb
evt-message_store-postgres-2.4.0.3 lib/message_store/postgres/controls/put.rb
evt-message_store-postgres-2.4.0.2 lib/message_store/postgres/controls/put.rb
evt-message_store-postgres-2.4.0.1 lib/message_store/postgres/controls/put.rb
evt-message_store-postgres-2.4.0.0 lib/message_store/postgres/controls/put.rb
evt-message_store-postgres-2.3.0.0 lib/message_store/postgres/controls/put.rb