event_store_client 0.1.17 → 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/lib/event_store_client/configuration.rb +4 -1
- data/lib/event_store_client/connection.rb +2 -8
- data/lib/event_store_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fe215b6cb4223f0045c80024230b91abbf911b497c7680209ba9fce087d23b7
|
4
|
+
data.tar.gz: 01e1b42502fa7d2f8750cd15362d78246690228282139f96c7b3e22c2c09807c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d7ddaa9efd38ff16f618e0878e3b1039d49a389f112624a31b142a7faa1cede30ed2295456b7e0681319f3e01466647e4ee78112a7e6abaa4d1e1d62282a476
|
7
|
+
data.tar.gz: 65fef0ec5e3cd8ef1a98c6ddcff0f19fe94ab80a2706de39879792b8e943fb19af91e751c063a0d0ad70ba152710a13800035bb9ed51df4b5d103ff22dbef652
|
data/README.md
CHANGED
@@ -45,6 +45,14 @@ Before you start, add this to the `initializer` or to the top of your script:
|
|
45
45
|
|
46
46
|
`EventStoreClient.configure`
|
47
47
|
|
48
|
+
For testing, you can use the InMemory adapter. To do it you should change the configuration.
|
49
|
+
|
50
|
+
```ruby
|
51
|
+
EventStoreClient.configure do |config|
|
52
|
+
config.adapter = EventStoreClient::StoreAdapter::InMemory.new(host: 'http://localhost', port: '2113')
|
53
|
+
end
|
54
|
+
```
|
55
|
+
|
48
56
|
### Create Dummy event and dummy Handler
|
49
57
|
|
50
58
|
To test out the behavior, you'll need a sample event and handler to work with:
|
@@ -7,7 +7,8 @@ module EventStoreClient
|
|
7
7
|
class Configuration
|
8
8
|
include Singleton
|
9
9
|
|
10
|
-
attr_accessor :host, :port, :per_page, :service_name, :mapper, :error_handler, :pid_path
|
10
|
+
attr_accessor :host, :port, :per_page, :service_name, :mapper, :error_handler, :pid_path,
|
11
|
+
:adapter
|
11
12
|
|
12
13
|
def configure
|
13
14
|
yield(self) if block_given?
|
@@ -23,6 +24,8 @@ module EventStoreClient
|
|
23
24
|
@mapper = Mapper::Default.new
|
24
25
|
@service_name = 'default'
|
25
26
|
@error_handler = nil
|
27
|
+
@adapter =
|
28
|
+
EventStoreClient::StoreAdapter::Api::Client.new(host: host, port: port, per_page: per_page)
|
26
29
|
end
|
27
30
|
end
|
28
31
|
end
|
@@ -50,7 +50,7 @@ module EventStoreClient
|
|
50
50
|
|
51
51
|
private
|
52
52
|
|
53
|
-
attr_reader :host, :port, :mapper, :per_page
|
53
|
+
attr_reader :host, :port, :mapper, :per_page, :client
|
54
54
|
|
55
55
|
def config
|
56
56
|
EventStoreClient::Configuration.instance
|
@@ -61,13 +61,7 @@ module EventStoreClient
|
|
61
61
|
@port = config.port
|
62
62
|
@per_page = config.per_page
|
63
63
|
@mapper = config.mapper
|
64
|
-
|
65
|
-
|
66
|
-
def client
|
67
|
-
@client ||=
|
68
|
-
EventStoreClient::StoreAdapter::Api::Client.new(
|
69
|
-
host: host, port: port, per_page: per_page
|
70
|
-
)
|
64
|
+
@client = config.adapter
|
71
65
|
end
|
72
66
|
|
73
67
|
def read_from_stream(stream, direction:, start:, resolve_links:)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: event_store_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Wilgosz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-schema
|