Class: HttpEventStore::Actions::ReadStreamEventsBackward

Inherits:
Object
  • Object
show all
Defined in:
lib/http_event_store/actions/read_stream_events_backward.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ ReadStreamEventsBackward

Returns a new instance of ReadStreamEventsBackward.


5
6
7
# File 'lib/http_event_store/actions/read_stream_events_backward.rb', line 5

def initialize(client)
  @client = client
end

Instance Method Details

#call(stream_name, start, count) ⇒ Object


9
10
11
12
13
14
15
# File 'lib/http_event_store/actions/read_stream_events_backward.rb', line 9

def call(stream_name, start, count)
  response = get_stream_batch(stream_name, start, count)
  return_events(response['entries'])
rescue ClientError => e
  raise StreamAlreadyDeleted if e.code == 410
  raise StreamNotFound if e.code == 404
end