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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2acc5e6e25f3d5fb77c44a7c6dc465442b307b4
4
- data.tar.gz: 155b6c787990989d49e59eb83190ad9adeb592f0
3
+ metadata.gz: f32f9a147b1122264cdef5eb29571ef0080c064c
4
+ data.tar.gz: 8b1dee6b091fa976459723bf8adf096098d0e0fe
5
5
  SHA512:
6
- metadata.gz: c65249eadde28bed09a39c7114569a5d420f6f356b139b135913db8b84e732751d65aa3e27e12e8706f44d25c8af67fef0c3afc344e03a0f941911873f46ae2f
7
- data.tar.gz: '0296ac0b29e449b14259be7f175898172f5fb8e65785f8e6cb082a95365d24dd969d26a2e4747df77a9e253db0c3a7149e9fd95a7c747a0b3cf60ee50d137cd8'
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`: name of the queue to be used by sidekiq worker
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
@@ -1,3 +1,3 @@
1
1
  module Materialist
2
- VERSION = '2.1.0'
2
+ VERSION = '2.2.0'
3
3
  end
@@ -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.1.0
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-15 00:00:00.000000000 Z
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