google-cloud-pubsub 2.6.0 → 2.6.1
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/CHANGELOG.md +7 -0
- data/lib/google/cloud/pubsub/subscriber.rb +22 -22
- data/lib/google/cloud/pubsub/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24eb8350951100fd325571412067861f44eab7575cadd16a8daee35ebf8f26ae
|
4
|
+
data.tar.gz: ae3c0aef696e531b2f5bfb61bbff09f4f50e4c42e62d94b027b38a620858aa88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7103a23c4129c14745401b84e41f6522518d6c64b0a89871c2af1bca4464d6883304a7e752411d35bf2bc2e3a877b3cbffc3afffed71df935cb98a3ee696a347
|
7
|
+
data.tar.gz: 425057b02a2ced62a0e55db13eddd0c67f377d4a34b98f90d225cc79a1261c99afb9bb7b67f96198c8d183af7708c9f15b409e5fa73c8cdbf96176e6efb441dd
|
data/CHANGELOG.md
CHANGED
@@ -128,28 +128,21 @@ module Google
|
|
128
128
|
|
129
129
|
##
|
130
130
|
# Immediately stops the subscriber. No new messages will be pulled from
|
131
|
-
# the subscription.
|
132
|
-
#
|
133
|
-
#
|
134
|
-
#
|
135
|
-
# received messages have been processed or released.
|
131
|
+
# the subscription. Use {#wait!} to block until all received messages have
|
132
|
+
# been processed or released: All actions taken on received messages that
|
133
|
+
# have not yet been sent to the API will be sent to the API. All received
|
134
|
+
# but unprocessed messages will be released back to the API and redelivered.
|
136
135
|
#
|
137
136
|
# @return [Subscriber] returns self so calls can be chained.
|
138
137
|
#
|
139
138
|
def stop
|
140
|
-
|
139
|
+
synchronize do
|
141
140
|
@started = false
|
142
141
|
@stopped = true
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
end
|
142
|
+
@stream_pool.map(&:stop)
|
143
|
+
wait_stop_buffer_thread!
|
144
|
+
self
|
147
145
|
end
|
148
|
-
stop_pool.map(&:join)
|
149
|
-
# Stop the buffer after the streams are all stopped
|
150
|
-
synchronize { @buffer.stop }
|
151
|
-
|
152
|
-
self
|
153
146
|
end
|
154
147
|
|
155
148
|
##
|
@@ -167,13 +160,8 @@ module Google
|
|
167
160
|
# @return [Subscriber] returns self so calls can be chained.
|
168
161
|
#
|
169
162
|
def wait! timeout = nil
|
170
|
-
|
171
|
-
|
172
|
-
Thread.new { stream.wait! timeout }
|
173
|
-
end
|
174
|
-
end
|
175
|
-
wait_pool.map(&:join)
|
176
|
-
|
163
|
+
wait_stop_buffer_thread!
|
164
|
+
@wait_stop_buffer_thread.join timeout
|
177
165
|
self
|
178
166
|
end
|
179
167
|
|
@@ -379,6 +367,18 @@ module Google
|
|
379
367
|
|
380
368
|
protected
|
381
369
|
|
370
|
+
##
|
371
|
+
# Starts a new thread to call wait! (blocking) on each Stream and then stop the TimedUnaryBuffer.
|
372
|
+
def wait_stop_buffer_thread!
|
373
|
+
synchronize do
|
374
|
+
@wait_stop_buffer_thread ||= Thread.new do
|
375
|
+
@stream_pool.map(&:wait!)
|
376
|
+
# Shutdown the buffer TimerTask (and flush the buffer) after the streams are all stopped.
|
377
|
+
@buffer.stop
|
378
|
+
end
|
379
|
+
end
|
380
|
+
end
|
381
|
+
|
382
382
|
def coerce_inventory inventory
|
383
383
|
@inventory = inventory
|
384
384
|
if @inventory.is_a? Hash
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-pubsub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Moore
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-04-
|
12
|
+
date: 2021-04-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: concurrent-ruby
|
@@ -275,7 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
275
275
|
- !ruby/object:Gem::Version
|
276
276
|
version: '0'
|
277
277
|
requirements: []
|
278
|
-
rubygems_version: 3.2.
|
278
|
+
rubygems_version: 3.2.16
|
279
279
|
signing_key:
|
280
280
|
specification_version: 4
|
281
281
|
summary: API Client library for Google Cloud Pub/Sub
|