queue-bus 0.11.0 → 0.12.0

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: 139511a2de01b9ffb7e58b63ecf62cbc01ae94fe38896282de2ae0dbb13178de
4
- data.tar.gz: 0e481639105b4dceff9991ee448f378923fdb3ae5820294f954602e96a177243
3
+ metadata.gz: 329cc0a74e428d99421a14c9b2b07e39e14ee98da5c43babceb51376d27006c6
4
+ data.tar.gz: 2439e577df8ea33e2f959b49ddfc105858844080556c4431a47897667d87fa92
5
5
  SHA512:
6
- metadata.gz: 3ce3ebbeee0e6be7513af1ed093f5612877a6293a78bad68da502817c10f205ddf69bbc3071ef497f48baef2e66f2823311ef80e579805dbeedccec9b0794bef
7
- data.tar.gz: 8b93e84ff4b5d6801d6b490560af46532c729eb7ff2b32b0d88e565bd620388d029f1a010027b9032e56731aef936945922bf7afc642453aeb9db9cbeacd0bcd
6
+ metadata.gz: 2875311c4100923fc00886ac05e2b4053ec6bfff442114faa6cc6bf39698916234866f57ebcbeb09dbcaca85484ca3bb0ce88cdbf8eb5640f6ca3b46d88a5a23
7
+ data.tar.gz: f7d88adffc92f2635b1068f47c68238787b55eea86d4302bc2579a40bc2c3ff4ce145d62688a7584a2b48fa31b03951b993757a0e3b65eb71a1b3a4715aeb741
data/CHANGELOG.md CHANGED
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.12.0]
10
+
11
+ ### Changed
12
+ - Pipelines fetching all queue subscriptions when using `QueueBus::Application.all`
13
+
9
14
  ## [0.11.0]
10
15
 
11
16
  ### Added
@@ -7,7 +7,22 @@ module QueueBus
7
7
  class << self
8
8
  def all
9
9
  # note the names arent the same as we started with
10
- ::QueueBus.redis { |redis| redis.smembers(app_list_key).collect { |val| new(val) } }
10
+ ::QueueBus.redis do |redis|
11
+ app_keys = redis.smembers(app_list_key)
12
+ apps = app_keys.collect { |val| new(val) }
13
+
14
+ hashes = redis.pipelined do
15
+ apps.each do |app|
16
+ redis.hgetall(app.redis_key)
17
+ end
18
+ end
19
+
20
+ apps.zip(hashes).each do |app, hash|
21
+ app._hydrate_redis_hash(hash)
22
+ end
23
+
24
+ apps
25
+ end
11
26
  end
12
27
  end
13
28
 
@@ -90,6 +105,10 @@ module QueueBus
90
105
  out
91
106
  end
92
107
 
108
+ def _hydrate_redis_hash(hash)
109
+ @raw_redis_hash = hash
110
+ end
111
+
93
112
  protected
94
113
 
95
114
  def self.normalize(val)
@@ -114,16 +133,24 @@ module QueueBus
114
133
 
115
134
  def read_redis_hash
116
135
  out = {}
117
- ::QueueBus.redis do |redis|
118
- redis.hgetall(redis_key).each do |key, val|
119
- begin
120
- out[key] = ::QueueBus::Util.decode(val)
121
- rescue ::QueueBus::Util::DecodeException
122
- out[key] = val
123
- end
136
+ raw_redis_hash.each do |key, val|
137
+ begin
138
+ out[key] = ::QueueBus::Util.decode(val)
139
+ rescue ::QueueBus::Util::DecodeException
140
+ out[key] = val
124
141
  end
125
142
  end
126
143
  out
127
144
  end
145
+
146
+ private
147
+
148
+ def raw_redis_hash
149
+ return @raw_redis_hash if @raw_redis_hash
150
+
151
+ ::QueueBus.redis do |redis|
152
+ redis.hgetall(redis_key)
153
+ end
154
+ end
128
155
  end
129
156
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module QueueBus
4
- VERSION = '0.11.0'
4
+ VERSION = '0.12.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: queue-bus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Leonard
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-16 00:00:00.000000000 Z
11
+ date: 2021-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -159,7 +159,7 @@ files:
159
159
  homepage: ''
160
160
  licenses: []
161
161
  metadata: {}
162
- post_install_message:
162
+ post_install_message:
163
163
  rdoc_options: []
164
164
  require_paths:
165
165
  - lib
@@ -174,9 +174,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  - !ruby/object:Gem::Version
175
175
  version: '0'
176
176
  requirements: []
177
- rubyforge_project: queue-bus
178
- rubygems_version: 2.7.6.2
179
- signing_key:
177
+ rubygems_version: 3.0.3
178
+ signing_key:
180
179
  specification_version: 4
181
180
  summary: A simple event bus on top of background queues
182
181
  test_files: