Class: Akasha::Storage::HttpEventStore
- Inherits:
-
Object
- Object
- Akasha::Storage::HttpEventStore
- Defined in:
- lib/akasha/storage/http_event_store.rb,
lib/akasha/storage/http_event_store/stream.rb
Overview
HTTP-based interface to Eventstore (geteventstore.com)
Defined Under Namespace
Classes: Stream
Instance Method Summary collapse
- #[](stream_name) ⇒ Object
-
#initialize(host: 'localhost', port: 2113) ⇒ HttpEventStore
constructor
A new instance of HttpEventStore.
- #streams ⇒ Object
Constructor Details
#initialize(host: 'localhost', port: 2113) ⇒ HttpEventStore
Returns a new instance of HttpEventStore.
8 9 10 11 12 13 |
# File 'lib/akasha/storage/http_event_store.rb', line 8 def initialize(host: 'localhost', port: 2113) @client = ::HttpEventStore::Connection.new do |config| config.endpoint = host config.port = port end end |
Instance Method Details
#[](stream_name) ⇒ Object
19 20 21 |
# File 'lib/akasha/storage/http_event_store.rb', line 19 def [](stream_name) Stream.new(@client, stream_name) end |
#streams ⇒ Object
15 16 17 |
# File 'lib/akasha/storage/http_event_store.rb', line 15 def streams self # Use the `[]` method on self. end |