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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e04bfd015838726c4fdd745c2a4fa04d22a7bbe7a79a255fcc19987697769fd8
4
- data.tar.gz: ab43471a308ba83145be50db01082b3a77b39f3b61b79384b37cd46f21c2dcfb
3
+ metadata.gz: e93469ccb43f93262792fbcc7c58a076930f3655dc39c059ad2f323305cea78d
4
+ data.tar.gz: f026ce8b7ca6054fc98c9904a0d4a400fc92f7076cb7c57b575b51f3646101c5
5
5
  SHA512:
6
- metadata.gz: ed5543bd1d0556486877c6ac13762c1baeb69e791272473d204a511c40451d381a9ebf82ce0bc819cd7fa68b3176c7886857b02a87bba170d24bb56d8e0689ea
7
- data.tar.gz: d89498904abfcc1e1f1ffd1425b6e5c847a82ddf170b0e2d497fcbe7f238112d8567540a7bf2294329a26ed778cf58df6fef9d805678bc7c2e7ff4ff3224dad4
6
+ metadata.gz: 552944e31e98a88fcdeff590ffca5b9a10bfe0150f74feb9c907b92b3597776e64bde50e29115072523f9df8acea495caad3ae61e964095bb8b44dfa9fafe968
7
+ data.tar.gz: 19a1d398e0255684aa3c8c4269d857cee51c25be4c7e6828741fad86c040ce5de5994a7cc7565644c8610c1939bcbb98ab036349b54db693b843896531135ab9
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 0.33.2 / 2018-10-29
4
+
5
+ * Rename delay methods to modify_ack_deadline
6
+ * Rename modify_ack_deadling aliases to delay
7
+ * This maintains backwards compatibility
8
+
3
9
  ### 0.33.1 / 2018-10-03
4
10
 
5
11
  * Update connection configuration.
@@ -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#delay! ReceivedMessage#delay!})
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.delay! 120
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#delay Subscription#delay})
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.delay 120, received_messages
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.delay! 120
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 delay! new_deadline
159
+ def modify_ack_deadline! new_deadline
160
160
  ensure_subscription!
161
- subscription.delay new_deadline, ack_id
161
+ subscription.modify_ack_deadline new_deadline, ack_id
162
162
  end
163
- alias modify_ack_deadline! delay!
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#delay!}). Default is 4.
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 delay deadline, ack_ids
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 delay deadline, ack_ids
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
@@ -13,8 +13,6 @@
13
13
  # limitations under the License.
14
14
 
15
15
 
16
- require "thread"
17
-
18
16
  module Google
19
17
  module Cloud
20
18
  module Pubsub
@@ -144,7 +144,7 @@ module Google
144
144
 
145
145
  ##
146
146
  # @private
147
- def delay deadline, *messages
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.delay 120, received_messages
494
+ # sub.modify_ack_deadline 120, received_messages
495
495
  #
496
- def delay new_deadline, *messages
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 delay
502
+ alias delay modify_ack_deadline
503
503
 
504
504
  ##
505
505
  # Creates a new {Snapshot} from the subscription. The created snapshot
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Pubsub
19
- VERSION = "0.33.1".freeze
19
+ VERSION = "0.33.2".freeze
20
20
  end
21
21
  end
22
22
  end
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.1
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-03 00:00:00.000000000 Z
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.50.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.50.0
167
+ version: 0.59.2
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: simplecov
170
170
  requirement: !ruby/object:Gem::Requirement