Class: MessageStore::EventStore::Get::Last
- Inherits:
-
Object
- Object
- MessageStore::EventStore::Get::Last
- Includes:
- Get::Last
- Defined in:
- lib/message_store/event_store/get/last.rb
Constant Summary collapse
- Assertions =
Get::Assertions
Instance Method Summary collapse
Instance Method Details
#call(stream_name) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/message_store/event_store/get/last.rb', line 22 def call(stream_name) begin , * = read_stream.( stream_name, position: :head, direction: :backward, batch_size: 1 ) rescue ::EventStore::HTTP::ReadStream::StreamNotFoundError end end |
#configure(session: nil) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/message_store/event_store/get/last.rb', line 10 def configure(session: nil) session = Session.configure(self, session: session) read_stream = ::EventStore::HTTP::ReadStream.configure( self, session: session ) read_stream. read_stream.output_schema = Result end |