class TransactionEventStore::Client
Public Instance Methods
last_stream_snapshot(stream_name)
click to toggle source
# File lib/transaction_event_store/client.rb, line 19 def last_stream_snapshot(stream_name) repository.last_stream_snapshot(stream_name) end
notify_subscribers(event)
click to toggle source
# File lib/transaction_event_store/client.rb, line 15 def notify_subscribers(event) event_broker.notify_subscribers(event) end
publish_snapshot(event, stream_name: GLOBAL_STREAM, expected_version: :any)
click to toggle source
# File lib/transaction_event_store/client.rb, line 9 def publish_snapshot(event, stream_name: GLOBAL_STREAM, expected_version: :any) validate_expected_version(stream_name, expected_version) repository.create_snapshot(event, stream_name) :ok end
read_all_streams_backward(start: :head, count: page_size)
click to toggle source
# File lib/transaction_event_store/client.rb, line 40 def read_all_streams_backward(start: :head, count: page_size) page = Page.new(repository, start, count) repository.read_all_streams_backward(page.start, page.count) end
read_all_streams_forward(start: :head, count: page_size)
click to toggle source
# File lib/transaction_event_store/client.rb, line 35 def read_all_streams_forward(start: :head, count: page_size) page = Page.new(repository, start, count) repository.read_all_streams_forward(page.start, page.count) end
read_events_backward(stream_name, start: :head, count: page_size)
click to toggle source
# File lib/transaction_event_store/client.rb, line 29 def read_events_backward(stream_name, start: :head, count: page_size) raise IncorrectStreamData if stream_name.nil? || stream_name.empty? page = Page.new(repository, start, count) repository.read_events_backward(stream_name, page.start, page.count) end
read_events_forward(stream_name, start: :head, count: page_size)
click to toggle source
# File lib/transaction_event_store/client.rb, line 23 def read_events_forward(stream_name, start: :head, count: page_size) raise IncorrectStreamData if stream_name.nil? || stream_name.empty? page = Page.new(repository, start, count) repository.read_events_forward(stream_name, page.start, page.count) end
with_lock(stream, &block)
click to toggle source
# File lib/transaction_event_store/client.rb, line 5 def with_lock(stream, &block) repository.with_lock(stream, &block) end