Class: Akasha::Storage::HttpEventStore

Inherits:
Object
  • Object
show all
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

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

#streamsObject



15
16
17
# File 'lib/akasha/storage/http_event_store.rb', line 15

def streams
  self # Use the `[]` method on self.
end