google-cloud-pubsub 0.33.1 → 0.33.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 +6 -0
- data/OVERVIEW.md +6 -4
- data/lib/google/cloud/pubsub/async_publisher.rb +4 -0
- data/lib/google/cloud/pubsub/received_message.rb +4 -4
- data/lib/google/cloud/pubsub/subscriber.rb +2 -1
- data/lib/google/cloud/pubsub/subscriber/async_stream_pusher.rb +2 -1
- data/lib/google/cloud/pubsub/subscriber/async_unary_pusher.rb +2 -1
- data/lib/google/cloud/pubsub/subscriber/enumerator_queue.rb +0 -2
- data/lib/google/cloud/pubsub/subscriber/stream.rb +2 -1
- data/lib/google/cloud/pubsub/subscription.rb +3 -3
- data/lib/google/cloud/pubsub/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e93469ccb43f93262792fbcc7c58a076930f3655dc39c059ad2f323305cea78d
|
4
|
+
data.tar.gz: f026ce8b7ca6054fc98c9904a0d4a400fc92f7076cb7c57b575b51f3646101c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 552944e31e98a88fcdeff590ffca5b9a10bfe0150f74feb9c907b92b3597776e64bde50e29115072523f9df8acea495caad3ae61e964095bb8b44dfa9fafe968
|
7
|
+
data.tar.gz: 19a1d398e0255684aa3c8c4269d857cee51c25be4c7e6828741fad86c040ce5de5994a7cc7565644c8610c1939bcbb98ab036349b54db693b843896531135ab9
|
data/CHANGELOG.md
CHANGED
data/OVERVIEW.md
CHANGED
@@ -257,7 +257,8 @@ A message must be acknowledged after it is pulled, or Pub/Sub will mark the
|
|
257
257
|
message for redelivery. The message acknowledgement deadline can delayed if more
|
258
258
|
time is needed. This will allow more time to process the message before the
|
259
259
|
message is marked for redelivery. (See
|
260
|
-
{Google::Cloud::Pubsub::ReceivedMessage#
|
260
|
+
{Google::Cloud::Pubsub::ReceivedMessage#modify_ack_deadline!
|
261
|
+
ReceivedMessage#modify_ack_deadline!})
|
261
262
|
|
262
263
|
```ruby
|
263
264
|
require "google/cloud/pubsub"
|
@@ -269,7 +270,7 @@ subscriber = sub.listen do |received_message|
|
|
269
270
|
puts received_message.message.data
|
270
271
|
|
271
272
|
# Delay for 2 minutes
|
272
|
-
received_message.
|
273
|
+
received_message.modify_ack_deadline! 120
|
273
274
|
end
|
274
275
|
|
275
276
|
# Start background threads that will call the block passed to listen.
|
@@ -302,7 +303,8 @@ subscriber.stop.wait!
|
|
302
303
|
```
|
303
304
|
|
304
305
|
Multiple messages can be delayed or made available for immediate redelivery:
|
305
|
-
(See {Google::Cloud::Pubsub::Subscription#
|
306
|
+
(See {Google::Cloud::Pubsub::Subscription#modify_ack_deadline
|
307
|
+
Subscription#modify_ack_deadline})
|
306
308
|
|
307
309
|
```ruby
|
308
310
|
require "google/cloud/pubsub"
|
@@ -311,7 +313,7 @@ pubsub = Google::Cloud::Pubsub.new
|
|
311
313
|
|
312
314
|
sub = pubsub.subscription "my-topic-sub"
|
313
315
|
received_messages = sub.pull
|
314
|
-
sub.
|
316
|
+
sub.modify_ack_deadline 120, received_messages
|
315
317
|
```
|
316
318
|
|
317
319
|
## Creating a snapshot and using seek
|
@@ -189,6 +189,8 @@ module Google
|
|
189
189
|
|
190
190
|
protected
|
191
191
|
|
192
|
+
# rubocop:disable Naming/MemoizedInstanceVariableName
|
193
|
+
|
192
194
|
def init_resources!
|
193
195
|
@first_published_at ||= Time.now
|
194
196
|
@publish_thread_pool ||= Concurrent::FixedThreadPool.new \
|
@@ -198,6 +200,8 @@ module Google
|
|
198
200
|
@thread ||= Thread.new { run_background }
|
199
201
|
end
|
200
202
|
|
203
|
+
# rubocop:enable Naming/MemoizedInstanceVariableName
|
204
|
+
|
201
205
|
def run_background
|
202
206
|
synchronize do
|
203
207
|
until @stopped
|
@@ -147,7 +147,7 @@ module Google
|
|
147
147
|
# puts received_message.message.data
|
148
148
|
#
|
149
149
|
# # Delay for 2 minutes
|
150
|
-
# received_message.
|
150
|
+
# received_message.modify_ack_deadline! 120
|
151
151
|
# end
|
152
152
|
#
|
153
153
|
# # Start background threads that will call block passed to listen.
|
@@ -156,11 +156,11 @@ module Google
|
|
156
156
|
# # Shut down the subscriber when ready to stop receiving messages.
|
157
157
|
# subscriber.stop.wait!
|
158
158
|
#
|
159
|
-
def
|
159
|
+
def modify_ack_deadline! new_deadline
|
160
160
|
ensure_subscription!
|
161
|
-
subscription.
|
161
|
+
subscription.modify_ack_deadline new_deadline, ack_id
|
162
162
|
end
|
163
|
-
alias
|
163
|
+
alias delay! modify_ack_deadline!
|
164
164
|
|
165
165
|
##
|
166
166
|
# Resets the acknowledge deadline for the message without acknowledging
|
@@ -57,7 +57,8 @@ module Google
|
|
57
57
|
# handle the received messages. Default is 8.
|
58
58
|
# @attr_reader [Integer] push_threads The number of threads to handle
|
59
59
|
# acknowledgement ({ReceivedMessage#ack!}) and delay messages
|
60
|
-
# ({ReceivedMessage#nack!}, {ReceivedMessage#
|
60
|
+
# ({ReceivedMessage#nack!}, {ReceivedMessage#modify_ack_deadline!}).
|
61
|
+
# Default is 4.
|
61
62
|
#
|
62
63
|
class Subscriber
|
63
64
|
include MonitorMixin
|
@@ -68,7 +68,7 @@ module Google
|
|
68
68
|
nil
|
69
69
|
end
|
70
70
|
|
71
|
-
def
|
71
|
+
def modify_ack_deadline deadline, ack_ids
|
72
72
|
return true if ack_ids.empty?
|
73
73
|
|
74
74
|
synchronize do
|
@@ -93,6 +93,7 @@ module Google
|
|
93
93
|
|
94
94
|
nil
|
95
95
|
end
|
96
|
+
alias delay modify_ack_deadline
|
96
97
|
|
97
98
|
def start
|
98
99
|
synchronize do
|
@@ -68,7 +68,7 @@ module Google
|
|
68
68
|
nil
|
69
69
|
end
|
70
70
|
|
71
|
-
def
|
71
|
+
def modify_ack_deadline deadline, ack_ids
|
72
72
|
return true if ack_ids.empty?
|
73
73
|
|
74
74
|
synchronize do
|
@@ -93,6 +93,7 @@ module Google
|
|
93
93
|
|
94
94
|
nil
|
95
95
|
end
|
96
|
+
alias delay modify_ack_deadline
|
96
97
|
|
97
98
|
def start
|
98
99
|
synchronize do
|
@@ -144,7 +144,7 @@ module Google
|
|
144
144
|
|
145
145
|
##
|
146
146
|
# @private
|
147
|
-
def
|
147
|
+
def modify_ack_deadline deadline, *messages
|
148
148
|
mod_ack_ids = coerce_ack_ids messages
|
149
149
|
return true if mod_ack_ids.empty?
|
150
150
|
|
@@ -157,6 +157,7 @@ module Google
|
|
157
157
|
|
158
158
|
true
|
159
159
|
end
|
160
|
+
alias delay modify_ack_deadline
|
160
161
|
|
161
162
|
def async_pusher
|
162
163
|
synchronize { @async_pusher }
|
@@ -491,15 +491,15 @@ module Google
|
|
491
491
|
#
|
492
492
|
# sub = pubsub.subscription "my-topic-sub"
|
493
493
|
# received_messages = sub.pull
|
494
|
-
# sub.
|
494
|
+
# sub.modify_ack_deadline 120, received_messages
|
495
495
|
#
|
496
|
-
def
|
496
|
+
def modify_ack_deadline new_deadline, *messages
|
497
497
|
ack_ids = coerce_ack_ids messages
|
498
498
|
ensure_service!
|
499
499
|
service.modify_ack_deadline name, ack_ids, new_deadline
|
500
500
|
true
|
501
501
|
end
|
502
|
-
alias modify_ack_deadline
|
502
|
+
alias delay modify_ack_deadline
|
503
503
|
|
504
504
|
##
|
505
505
|
# Creates a new {Snapshot} from the subscription. The created snapshot
|
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: 0.33.
|
4
|
+
version: 0.33.2
|
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: 2018-10-
|
12
|
+
date: 2018-10-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-cloud-core
|
@@ -157,14 +157,14 @@ dependencies:
|
|
157
157
|
requirements:
|
158
158
|
- - "~>"
|
159
159
|
- !ruby/object:Gem::Version
|
160
|
-
version: 0.
|
160
|
+
version: 0.59.2
|
161
161
|
type: :development
|
162
162
|
prerelease: false
|
163
163
|
version_requirements: !ruby/object:Gem::Requirement
|
164
164
|
requirements:
|
165
165
|
- - "~>"
|
166
166
|
- !ruby/object:Gem::Version
|
167
|
-
version: 0.
|
167
|
+
version: 0.59.2
|
168
168
|
- !ruby/object:Gem::Dependency
|
169
169
|
name: simplecov
|
170
170
|
requirement: !ruby/object:Gem::Requirement
|