Class: EventStoreClient::GRPC::Commands::Streams::ReadAll
- Includes:
- Configuration
- Defined in:
- lib/event_store_client/adapters/grpc/commands/streams/read_all.rb
Instance Method Summary collapse
Methods included from Configuration
Methods inherited from Command
Instance Method Details
#call(stream_name, options: {}) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/event_store_client/adapters/grpc/commands/streams/read_all.rb', line 21 def call(stream_name, options: {}) start ||= [:start] || 0 count ||= [:count] || 20 events = [] loop do res = Read.new.call( stream_name, options: .merge(start: start, count: count) ) break if res.failure? break if (entries = res.value!).empty? events += entries start += count end Success(events) end |