Class: HttpEventstore::Connection
- Inherits:
-
Object
- Object
- HttpEventstore::Connection
- Defined in:
- lib/http_eventstore/connection.rb
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#page_size ⇒ Object
Returns the value of attribute page_size.
-
#port ⇒ Object
Returns the value of attribute port.
Instance Method Summary collapse
- #append_to_stream(stream_name, event_data, expected_version = nil) ⇒ Object
- #delete_stream(stream_name, hard_delete = false) ⇒ Object
-
#initialize {|_self| ... } ⇒ Connection
constructor
A new instance of Connection.
- #read_all_events_backward(stream_name) ⇒ Object
- #read_all_events_forward(stream_name) ⇒ Object
- #read_events_backward(stream_name, start, count) ⇒ Object
- #read_events_forward(stream_name, start, count, pool = 0) ⇒ Object
Constructor Details
#initialize {|_self| ... } ⇒ Connection
Returns a new instance of Connection.
5 6 7 8 |
# File 'lib/http_eventstore/connection.rb', line 5 def initialize setup_defaults yield(self) if block_given? end |
Instance Attribute Details
#endpoint ⇒ Object
Returns the value of attribute endpoint.
3 4 5 |
# File 'lib/http_eventstore/connection.rb', line 3 def endpoint @endpoint end |
#page_size ⇒ Object
Returns the value of attribute page_size.
3 4 5 |
# File 'lib/http_eventstore/connection.rb', line 3 def page_size @page_size end |
#port ⇒ Object
Returns the value of attribute port.
3 4 5 |
# File 'lib/http_eventstore/connection.rb', line 3 def port @port end |
Instance Method Details
#append_to_stream(stream_name, event_data, expected_version = nil) ⇒ Object
10 11 12 |
# File 'lib/http_eventstore/connection.rb', line 10 def append_to_stream(stream_name, event_data, expected_version = nil) Actions::AppendEventToStream.new(client).call(stream_name, event_data, expected_version) end |
#delete_stream(stream_name, hard_delete = false) ⇒ Object
14 15 16 |
# File 'lib/http_eventstore/connection.rb', line 14 def delete_stream(stream_name, hard_delete = false) Actions::DeleteStream.new(client).call(stream_name, hard_delete) end |
#read_all_events_backward(stream_name) ⇒ Object
30 31 32 |
# File 'lib/http_eventstore/connection.rb', line 30 def read_all_events_backward(stream_name) Actions::ReadAllStreamEventsBackward.new(client, page_size).call(stream_name) end |
#read_all_events_forward(stream_name) ⇒ Object
26 27 28 |
# File 'lib/http_eventstore/connection.rb', line 26 def read_all_events_forward(stream_name) Actions::ReadAllStreamEventsForward.new(client, page_size).call(stream_name) end |
#read_events_backward(stream_name, start, count) ⇒ Object
22 23 24 |
# File 'lib/http_eventstore/connection.rb', line 22 def read_events_backward(stream_name, start, count) Actions::ReadStreamEventsBackward.new(client).call(stream_name, start, count) end |
#read_events_forward(stream_name, start, count, pool = 0) ⇒ Object
18 19 20 |
# File 'lib/http_eventstore/connection.rb', line 18 def read_events_forward(stream_name, start, count, pool = 0) Actions::ReadStreamEventsForward.new(client).call(stream_name, start, count, pool) end |