redstream 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/redstream/delayer.rb +2 -2
- data/lib/redstream/producer.rb +8 -8
- data/lib/redstream/version.rb +1 -1
- data/redstream.gemspec +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 400e4270e920ace54c661a275cf467c7f929a554b937999175d47198b8b403eb
|
4
|
+
data.tar.gz: e38676096310d5fb55f63d9e49971491e7a184cfb5d633390b7085bcb3762903
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 729fee0ff31002c70c83ff5428352e0d7818d8b333259adce8aa150da8748df10daf40c03e7b2b5c28ba0ac1f48dee516b1e35e6e7201652dbba653a4e84d1a4
|
7
|
+
data.tar.gz: dee5156c1df03d23d5fd9aafdb57b3bf8a8e2f2c983242e4feab970415aa2851b9203f8a77cee02a534e5c2571b360ecb6a3360aae81f06d90e291a2f4591a7c
|
data/CHANGELOG.md
CHANGED
data/lib/redstream/delayer.rb
CHANGED
@@ -83,9 +83,9 @@ module Redstream
|
|
83
83
|
@logger.debug "Delayed #{@batch.size} messages for #{@delay.to_f} seconds on stream #{@stream_name}"
|
84
84
|
|
85
85
|
Redstream.connection_pool.with do |redis|
|
86
|
-
redis.pipelined do
|
86
|
+
redis.pipelined do |pipeline|
|
87
87
|
@batch.each do |message|
|
88
|
-
|
88
|
+
pipeline.xadd(Redstream.stream_key_name(@stream_name), { payload: message.fields["payload"] })
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
data/lib/redstream/producer.rb
CHANGED
@@ -70,9 +70,9 @@ module Redstream
|
|
70
70
|
def bulk_delay(records)
|
71
71
|
res = records.each_slice(250).flat_map do |slice|
|
72
72
|
Redstream.connection_pool.with do |redis|
|
73
|
-
redis.pipelined do
|
73
|
+
redis.pipelined do |pipeline|
|
74
74
|
slice.each do |object|
|
75
|
-
|
75
|
+
pipeline.xadd(Redstream.stream_key_name("#{stream_name(object)}.delay"), { payload: JSON.dump(object.redstream_payload) })
|
76
76
|
end
|
77
77
|
end
|
78
78
|
end
|
@@ -95,10 +95,10 @@ module Redstream
|
|
95
95
|
def bulk_queue(records, delay_message_ids: nil)
|
96
96
|
records.each_with_index.each_slice(250) do |slice|
|
97
97
|
Redstream.connection_pool.with do |redis|
|
98
|
-
redis.pipelined do
|
98
|
+
redis.pipelined do |pipeline|
|
99
99
|
slice.each do |object, index|
|
100
|
-
|
101
|
-
|
100
|
+
pipeline.xadd(Redstream.stream_key_name(stream_name(object)), { payload: JSON.dump(object.redstream_payload) })
|
101
|
+
pipeline.xdel(Redstream.stream_key_name("#{stream_name(object)}.delay"), delay_message_ids[index]) if delay_message_ids
|
102
102
|
end
|
103
103
|
end
|
104
104
|
end
|
@@ -132,9 +132,9 @@ module Redstream
|
|
132
132
|
|
133
133
|
def queue(object, delay_message_id: nil)
|
134
134
|
Redstream.connection_pool.with do |redis|
|
135
|
-
redis.pipelined do
|
136
|
-
|
137
|
-
|
135
|
+
redis.pipelined do |pipeline|
|
136
|
+
pipeline.xadd(Redstream.stream_key_name(stream_name(object)), { payload: JSON.dump(object.redstream_payload) })
|
137
|
+
pipeline.xdel(Redstream.stream_key_name("#{stream_name(object)}.delay"), delay_message_id) if delay_message_id
|
138
138
|
end
|
139
139
|
end
|
140
140
|
|
data/lib/redstream/version.rb
CHANGED
data/redstream.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redstream
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Vetter
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -226,14 +226,14 @@ dependencies:
|
|
226
226
|
requirements:
|
227
227
|
- - ">="
|
228
228
|
- !ruby/object:Gem::Version
|
229
|
-
version: 4.
|
229
|
+
version: 4.6.0
|
230
230
|
type: :runtime
|
231
231
|
prerelease: false
|
232
232
|
version_requirements: !ruby/object:Gem::Requirement
|
233
233
|
requirements:
|
234
234
|
- - ">="
|
235
235
|
- !ruby/object:Gem::Version
|
236
|
-
version: 4.
|
236
|
+
version: 4.6.0
|
237
237
|
description: Using redis streams to keep your primary database in sync with secondary
|
238
238
|
datastores
|
239
239
|
email:
|
@@ -274,7 +274,7 @@ homepage: https://github.com/mrkamel/redstream
|
|
274
274
|
licenses:
|
275
275
|
- MIT
|
276
276
|
metadata: {}
|
277
|
-
post_install_message:
|
277
|
+
post_install_message:
|
278
278
|
rdoc_options: []
|
279
279
|
require_paths:
|
280
280
|
- lib
|
@@ -289,8 +289,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
289
289
|
- !ruby/object:Gem::Version
|
290
290
|
version: '0'
|
291
291
|
requirements: []
|
292
|
-
rubygems_version: 3.
|
293
|
-
signing_key:
|
292
|
+
rubygems_version: 3.3.3
|
293
|
+
signing_key:
|
294
294
|
specification_version: 4
|
295
295
|
summary: Using redis streams to keep your primary database in sync with secondary
|
296
296
|
datastores
|