materialist 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/RELEASE_NOTES.md +50 -0
- data/lib/materialist.rb +1 -1
- data/lib/materialist/event_handler.rb +5 -2
- data/spec/materialist/event_handler_spec.rb +12 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f32f9a147b1122264cdef5eb29571ef0080c064c
|
4
|
+
data.tar.gz: 8b1dee6b091fa976459723bf8adf096098d0e0fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9c94a53752b839970d4293870ab7de99bda93019e1df6e1320c574771173188d31fe27d801d0f3b0dffdce98a80f047bd1be311dde849759166e59a62226467
|
7
|
+
data.tar.gz: 1204895096c3f37b369bac5219d6808b174acf0054cf7e32a66a4030d05d3d2b8b52d296d779445fb42babf3f26fdf438cffb2a27474e34afa3b4635afaeb48c
|
data/README.md
CHANGED
@@ -64,7 +64,8 @@ Where options could be:
|
|
64
64
|
|
65
65
|
- `topics` (only when using in `.subscribe`): An array of topics to be used.
|
66
66
|
If not provided nothing would be materialized.
|
67
|
-
- `queue
|
67
|
+
- `queue` (optional): name of the queue to be used by sidekiq worker
|
68
|
+
- `retry` (default: `10`): sidekiq retry policy to be used.
|
68
69
|
|
69
70
|
Then there are two ways to configure materialist in routemaster:
|
70
71
|
|
data/RELEASE_NOTES.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
## 2.2.0
|
2
|
+
|
3
|
+
Features:
|
4
|
+
|
5
|
+
- Default retry option plus, allow specifying it (#25)
|
6
|
+
|
7
|
+
## 2.1.0
|
8
|
+
|
9
|
+
Features:
|
10
|
+
|
11
|
+
- Allow source key to be specified (#30)
|
12
|
+
|
13
|
+
## 2.0.0
|
14
|
+
|
15
|
+
Breaking Changes:
|
16
|
+
|
17
|
+
- Don't serialize hashes and arrays (#29)
|
18
|
+
|
19
|
+
## 1.0.0
|
20
|
+
|
21
|
+
Features:
|
22
|
+
|
23
|
+
- Add support for capture_link_href (#26)
|
24
|
+
- Allow serialisation of complex types to json (#28)
|
25
|
+
|
26
|
+
## 0.0.5
|
27
|
+
|
28
|
+
Features:
|
29
|
+
|
30
|
+
- Make it possible to materialise linked resource without materialising self (#22)
|
31
|
+
|
32
|
+
## 0.0.4
|
33
|
+
|
34
|
+
Fix:
|
35
|
+
|
36
|
+
- Class name inflection (#20)
|
37
|
+
|
38
|
+
## 0.0.3
|
39
|
+
|
40
|
+
Changes:
|
41
|
+
|
42
|
+
- Feature: Materialized record allow nil (#13)
|
43
|
+
- Fix: Handle race condition on upsert (#14)
|
44
|
+
|
45
|
+
## 0.0.2
|
46
|
+
|
47
|
+
Features:
|
48
|
+
|
49
|
+
- support for after_destroy in materialiser DSL (#5)
|
50
|
+
- MaterializedRecord utility (#2)
|
data/lib/materialist.rb
CHANGED
@@ -4,8 +4,11 @@ require_relative './event_worker'
|
|
4
4
|
module Materialist
|
5
5
|
class EventHandler
|
6
6
|
|
7
|
+
# 10 retries takes approximately 6 hours
|
8
|
+
DEFAULT_OPTIONS = { retry: 10 }
|
9
|
+
|
7
10
|
def initialize(options={})
|
8
|
-
@options = options
|
11
|
+
@options = DEFAULT_OPTIONS.merge(options)
|
9
12
|
end
|
10
13
|
|
11
14
|
def on_events_received(batch)
|
@@ -25,7 +28,7 @@ module Materialist
|
|
25
28
|
end
|
26
29
|
|
27
30
|
def worker
|
28
|
-
Materialist::EventWorker.set(options.slice(:queue))
|
31
|
+
Materialist::EventWorker.set(options.slice(:queue, :retry))
|
29
32
|
end
|
30
33
|
end
|
31
34
|
end
|
@@ -59,7 +59,18 @@ RSpec.describe Materialist::EventHandler do
|
|
59
59
|
|
60
60
|
it "enqueues the event in the given queue" do
|
61
61
|
expect(Materialist::EventWorker).to receive(:set)
|
62
|
-
.with(queue: queue_name)
|
62
|
+
.with(queue: queue_name, retry: 10)
|
63
|
+
expect(worker_double).to receive(:perform_async).with(event)
|
64
|
+
perform
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
context "when a retry is specified in options" do
|
69
|
+
let(:options) {{ retry: false }}
|
70
|
+
|
71
|
+
it "uses the given retry option for sidekiq" do
|
72
|
+
expect(Materialist::EventWorker).to receive(:set)
|
73
|
+
.with(retry: false)
|
63
74
|
expect(worker_double).to receive(:perform_async).with(event)
|
64
75
|
perform
|
65
76
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: materialist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mo Valipour
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|
@@ -167,6 +167,7 @@ files:
|
|
167
167
|
- Guardfile
|
168
168
|
- LICENSE.txt
|
169
169
|
- README.md
|
170
|
+
- RELEASE_NOTES.md
|
170
171
|
- Rakefile
|
171
172
|
- appraise
|
172
173
|
- lib/materialist.rb
|