google-cloud-pubsub 0.39.1 → 0.39.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: cf882043d5708f044079a8f088e7dd086f0937699c3bb3dd84576a91104068d8
4
- data.tar.gz: e3dcd45ebe5db15aed15e0da2a107c92886eccdb750dd48bb5ea917180fb8e62
3
+ metadata.gz: 4f34b6b5827c709ce82dec3ae2c24557ec83f77bd8e381d32d82f100532894e3
4
+ data.tar.gz: 4a07069df138d0bf056421edcf1f0f611ad5911e7317f16e2561dcc0421daba1
5
5
  SHA512:
6
- metadata.gz: ffa8488744cc16ff26a842123b6ddbf4abc785936ae94212da3ae73c78aa4c7cc98965529ce074036befb878e05d109aca7c8024c810919d663232542d721228
7
- data.tar.gz: daa27cdc0f831d25e0d4ece569d4ff6c8bc3150b92b7221b3ab531f3d267ed398c7fc130db815cd7df8036a6f2efbd3a544c2d36c059b739cce23db45db700da
6
+ metadata.gz: a52c5e7fd8d4425f1beab86ac4235b817148f4e89992a7cdcfee7e3c87a4706334f12489aa7d7b305575d42cd446a4b714cd97f7132e3b61ac782f41bfcc6f87
7
+ data.tar.gz: ff2bfa65c4f97d6ec09602d4fdf889f279531b45ec55bc4e4d70481530e978a85f22832fc42d08bf14b11caf9ad3970411570da97b970c0ceda4a30d44153b7a
@@ -1,5 +1,17 @@
1
1
  # Release History
2
2
 
3
+ ### 0.39.2 / 2019-09-17
4
+
5
+ #### Bug Fixes
6
+
7
+ * Do not interrupt Subscriber callbacks when stopping
8
+ * Allow in-process callbacks to complete when a Subscriber is stopped.
9
+
10
+ #### Documentation
11
+
12
+ * Update Subscriber stop and wait documentation
13
+ * Update Subscriber#stop and Subscriber#wait! method
14
+
3
15
  ### 0.39.1 / 2019-09-04
4
16
 
5
17
  #### Features
@@ -123,10 +123,12 @@ module Google
123
123
  end
124
124
 
125
125
  ##
126
- # Begins the process of stopping the subscriber. Unhandled received
127
- # messages will be processed, but no new messages will be pulled from
128
- # the subscription. Use {#wait!} to block until the subscriber is fully
129
- # stopped and all received messages have been processed.
126
+ # Immediately stops the subscriber. No new messages will be pulled from
127
+ # the subscription. All actions taken on received messages that have not
128
+ # yet been sent to the API will be sent to the API. All received but
129
+ # unprocessed messages will be released back to the API and redelivered.
130
+ # Use {#wait!} to block until the subscriber is fully stopped and all
131
+ # received messages have been processed or released.
130
132
  #
131
133
  # @return [Subscriber] returns self so calls can be chained.
132
134
  def stop
@@ -147,9 +149,11 @@ module Google
147
149
 
148
150
  ##
149
151
  # Blocks until the subscriber is fully stopped and all received messages
150
- # have been handled. Does not stop the subscriber. To stop the
151
- # subscriber, first call {#stop} and then call {#wait!} to block until
152
- # the subscriber is stopped.
152
+ # have been processed or released.
153
+ #
154
+ # Does not stop the subscriber. To stop the subscriber, first call
155
+ # {#stop} and then call {#wait!} to block until the subscriber is
156
+ # stopped.
153
157
  #
154
158
  # @return [Subscriber] returns self so calls can be chained.
155
159
  def wait!
@@ -88,8 +88,9 @@ module Google
88
88
  @pause_cond.broadcast
89
89
 
90
90
  # Now that the reception thread is stopped, immediately stop the
91
- # callback thread pool and purge all pending callbacks.
92
- @callback_thread_pool.kill
91
+ # callback thread pool. All queued callbacks will see the stream
92
+ # is stopped and perform a noop.
93
+ @callback_thread_pool.shutdown
93
94
 
94
95
  # Once all the callbacks are stopped, we can stop the inventory.
95
96
  @inventory.stop
@@ -107,6 +108,9 @@ module Google
107
108
  end
108
109
 
109
110
  def wait!
111
+ # Wait for all queued callbacks to be processed.
112
+ @callback_thread_pool.wait_for_termination 60
113
+
110
114
  self
111
115
  end
112
116
 
@@ -268,14 +272,14 @@ module Google
268
272
  return unless callback_thread_pool.running?
269
273
 
270
274
  Concurrent::Promises.future_on(
271
- callback_thread_pool, @subscriber, @inventory, rec_msg
272
- ) do |sub, inv, msg|
275
+ callback_thread_pool, self, rec_msg
276
+ ) do |stream, msg|
273
277
  begin
274
- sub.callback.call msg
278
+ stream.subscriber.callback.call msg unless stream.stopped?
275
279
  rescue StandardError => callback_error
276
- sub.error! callback_error
280
+ stream.subscriber.error! callback_error
277
281
  ensure
278
- inv.remove msg.ack_id
282
+ stream.inventory.remove msg.ack_id
279
283
  end
280
284
  end
281
285
  end
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module PubSub
19
- VERSION = "0.39.1".freeze
19
+ VERSION = "0.39.2".freeze
20
20
  end
21
21
 
22
22
  Pubsub = PubSub unless const_defined? :Pubsub
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.39.1
4
+ version: 0.39.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: 2019-09-04 00:00:00.000000000 Z
12
+ date: 2019-09-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-cloud-core