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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb01602a9b0e51f896989d59b5e2b16f333c7ea0317f31c5235696bc49145013
4
- data.tar.gz: 747f63e94c847be8d371e60098f9348f30531587b821ac019c873c10d51dd766
3
+ metadata.gz: 400e4270e920ace54c661a275cf467c7f929a554b937999175d47198b8b403eb
4
+ data.tar.gz: e38676096310d5fb55f63d9e49971491e7a184cfb5d633390b7085bcb3762903
5
5
  SHA512:
6
- metadata.gz: 19541261544b2d32168b8e290e402b5c9dedcf54868dee1dbb556bfa5cacf41a091fbff391605a734a6c1bf5eeaf6b33127660b190245166e1340a777c5e433d
7
- data.tar.gz: 74426b36ca249b2da61f436f195d6811245038835492321009d063f78226cfdc7e099a4e17fe9910588ebc3f9bc6e21bec8e600959e0e5f8c2e77425ccda7023
6
+ metadata.gz: 729fee0ff31002c70c83ff5428352e0d7818d8b333259adce8aa150da8748df10daf40c03e7b2b5c28ba0ac1f48dee516b1e35e6e7201652dbba653a4e84d1a4
7
+ data.tar.gz: dee5156c1df03d23d5fd9aafdb57b3bf8a8e2f2c983242e4feab970415aa2851b9203f8a77cee02a534e5c2571b360ecb6a3360aae81f06d90e291a2f4591a7c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v0.4.2
4
+ * Fix pipelining with redis-rb 4.6.0
5
+
3
6
  ## v0.4.1
4
7
  * Fix keyword argument usage of redis 4.5.1 in ruby 3
5
8
 
@@ -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
- redis.xadd(Redstream.stream_key_name(@stream_name), { payload: message.fields["payload"] })
88
+ pipeline.xadd(Redstream.stream_key_name(@stream_name), { payload: message.fields["payload"] })
89
89
  end
90
90
  end
91
91
 
@@ -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
- redis.xadd(Redstream.stream_key_name("#{stream_name(object)}.delay"), { payload: JSON.dump(object.redstream_payload) })
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
- redis.xadd(Redstream.stream_key_name(stream_name(object)), { payload: JSON.dump(object.redstream_payload) })
101
- redis.xdel(Redstream.stream_key_name("#{stream_name(object)}.delay"), delay_message_ids[index]) if delay_message_ids
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
- redis.xadd(Redstream.stream_key_name(stream_name(object)), { payload: JSON.dump(object.redstream_payload) })
137
- redis.xdel(Redstream.stream_key_name("#{stream_name(object)}.delay"), delay_message_id) if delay_message_id
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
 
@@ -1,3 +1,3 @@
1
1
  module Redstream
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
data/redstream.gemspec CHANGED
@@ -33,5 +33,5 @@ Gem::Specification.new do |spec|
33
33
  spec.add_dependency "activesupport"
34
34
  spec.add_dependency "connection_pool"
35
35
  spec.add_dependency "json"
36
- spec.add_dependency "redis", ">= 4.1.0"
36
+ spec.add_dependency "redis", ">= 4.6.0"
37
37
  end
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.1
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: 2021-12-07 00:00:00.000000000 Z
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.1.0
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.1.0
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.2.15
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