Sha256: ca4d50e223c83c8a8e7fada2c19543c2f7b9603991bc2177392f08e4ae936911

Contents?: true

Size: 1 KB

Versions: 20

Compression:

Stored size: 1 KB

Contents

# frozen_string_literal: true

module PgEventstore
  module Commands
    # @!visibility private
    class Read < AbstractCommand
      # @param stream [PgEventstore::Stream]
      # @param options [Hash] request options
      # @option options [String] :direction read direction - 'Forwards' or 'Backwards'
      # @option options [Integer, Symbol] :from_revision. **Use this option when stream name is a normal stream name**
      # @option options [Integer, Symbol] :from_position. **Use this option when reading from "all" stream**
      # @option options [Integer] :max_count
      # @option options [Boolean] :resolve_link_tos
      # @option options [Hash] :filter provide it to filter events
      # @return [Array<PgEventstore::Event>]
      # @raise [PgEventstore::StreamNotFoundError]
      def call(stream, options: {})
        queries.events.stream_revision(stream) || raise(StreamNotFoundError, stream) unless stream.all_stream?

        queries.events.stream_events(stream, options)
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
pg_eventstore-1.6.0 lib/pg_eventstore/commands/read.rb
pg_eventstore-1.5.0 lib/pg_eventstore/commands/read.rb
pg_eventstore-1.4.0 lib/pg_eventstore/commands/read.rb
pg_eventstore-1.3.4 lib/pg_eventstore/commands/read.rb
pg_eventstore-1.3.3 lib/pg_eventstore/commands/read.rb
pg_eventstore-1.3.2 lib/pg_eventstore/commands/read.rb
pg_eventstore-1.3.1 lib/pg_eventstore/commands/read.rb
pg_eventstore-1.3.0 lib/pg_eventstore/commands/read.rb
pg_eventstore-1.2.0 lib/pg_eventstore/commands/read.rb
pg_eventstore-1.1.5 lib/pg_eventstore/commands/read.rb
pg_eventstore-1.1.4 lib/pg_eventstore/commands/read.rb
pg_eventstore-1.1.3 lib/pg_eventstore/commands/read.rb
pg_eventstore-1.1.2 lib/pg_eventstore/commands/read.rb
pg_eventstore-1.1.1 lib/pg_eventstore/commands/read.rb
pg_eventstore-1.1.0 lib/pg_eventstore/commands/read.rb
pg_eventstore-1.0.4 lib/pg_eventstore/commands/read.rb
pg_eventstore-1.0.0.rc2 lib/pg_eventstore/commands/read.rb
pg_eventstore-1.0.0.rc1 lib/pg_eventstore/commands/read.rb
pg_eventstore-0.10.2 lib/pg_eventstore/commands/read.rb
pg_eventstore-0.10.1 lib/pg_eventstore/commands/read.rb