google-cloud-pubsub 0.37.1 → 0.38.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/LOGGING.md +1 -1
- data/lib/google/cloud/pubsub/async_publisher.rb +2 -2
- data/lib/google/cloud/pubsub/project.rb +8 -3
- data/lib/google/cloud/pubsub/service.rb +14 -5
- data/lib/google/cloud/pubsub/subscriber/stream.rb +1 -1
- data/lib/google/cloud/pubsub/subscriber/timed_unary_buffer.rb +1 -1
- data/lib/google/cloud/pubsub/topic.rb +24 -0
- data/lib/google/cloud/pubsub/version.rb +1 -1
- data/lib/google/cloud/pubsub.rb +3 -0
- data/lib/google-cloud-pubsub.rb +1 -0
- 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: 7d5381a504110817167a469d767b176debfe597ba4388de028485ef49118cc83
|
4
|
+
data.tar.gz: 83915c1329784d01e58d208dff9e713417d768a26a2924e54f3e7ab48edfd453
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce37e8734b042325330222d29672abf5f7f77334b4bc03d21ff234aefdd5c9865edb4e6c0c33660855f229f9cc8c3c6ce06bb42db0e0d0edf45adb564523a9ff
|
7
|
+
data.tar.gz: 3c5da92014d6c54983930b380146f86c79a5ab7474b17d1bb3361f1c13418d513836045ff5f6211f244185694bde54465cceebf95e598842145727219597a453
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
### 0.38.0 / 2019-07-31
|
4
|
+
|
5
|
+
* Allow persistence_regions to be set
|
6
|
+
* Support setting persistence_regions on topic creation
|
7
|
+
and topic update.
|
8
|
+
* Allow Service endpoint to be configured
|
9
|
+
* Google::Cloud::PubSub.configure.endpoint
|
10
|
+
* Fix max threads setting in thread pools
|
11
|
+
* Thread pools once again limit the number of threads allocated.
|
12
|
+
* Reduce thread usage at startup
|
13
|
+
* Allocate threads in pool as needed, not all up front
|
14
|
+
* Update documentation links
|
15
|
+
|
3
16
|
### 0.37.1 / 2019-07-09
|
4
17
|
|
5
18
|
* Add IAM GetPolicyOptions in the lower-level interface.
|
data/LOGGING.md
CHANGED
@@ -5,7 +5,7 @@ To enable logging for this library, set the logger for the underlying
|
|
5
5
|
that you set may be a Ruby stdlib
|
6
6
|
[`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as
|
7
7
|
shown below, or a
|
8
|
-
[`Google::Cloud::Logging::Logger`](https://googleapis.
|
8
|
+
[`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
9
9
|
that will write logs to [Stackdriver
|
10
10
|
Logging](https://cloud.google.com/logging/). See
|
11
11
|
[grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
@@ -193,9 +193,9 @@ module Google
|
|
193
193
|
|
194
194
|
def init_resources!
|
195
195
|
@first_published_at ||= Time.now
|
196
|
-
@publish_thread_pool ||= Concurrent::
|
196
|
+
@publish_thread_pool ||= Concurrent::ThreadPoolExecutor.new \
|
197
197
|
max_threads: @publish_threads
|
198
|
-
@callback_thread_pool ||= Concurrent::
|
198
|
+
@callback_thread_pool ||= Concurrent::ThreadPoolExecutor.new \
|
199
199
|
max_threads: @callback_threads
|
200
200
|
@thread ||= Thread.new { run_background }
|
201
201
|
end
|
@@ -174,6 +174,9 @@ module Google
|
|
174
174
|
# @param [String] kms_key The Cloud KMS encryption key that will be used
|
175
175
|
# to protect access to messages published on this topic. Optional.
|
176
176
|
# For example: `projects/a/locations/b/keyRings/c/cryptoKeys/d`
|
177
|
+
# @param [Array<String>] persistence_regions The list of GCP region IDs
|
178
|
+
# where messages that are published to the topic may be persisted in
|
179
|
+
# storage. Optional.
|
177
180
|
# @param [Hash] async A hash of values to configure the topic's
|
178
181
|
# {AsyncPublisher} that is created when {Topic#publish_async}
|
179
182
|
# is called. Optional.
|
@@ -202,11 +205,13 @@ module Google
|
|
202
205
|
# pubsub = Google::Cloud::PubSub.new
|
203
206
|
# topic = pubsub.create_topic "my-topic"
|
204
207
|
#
|
205
|
-
def create_topic topic_name, labels: nil, kms_key: nil,
|
208
|
+
def create_topic topic_name, labels: nil, kms_key: nil,
|
209
|
+
persistence_regions: nil, async: nil
|
206
210
|
ensure_service!
|
207
211
|
grpc = service.create_topic topic_name,
|
208
|
-
labels:
|
209
|
-
kms_key_name:
|
212
|
+
labels: labels,
|
213
|
+
kms_key_name: kms_key,
|
214
|
+
persistence_regions: persistence_regions
|
210
215
|
Topic.from_grpc grpc, service, async: async
|
211
216
|
end
|
212
217
|
alias new_topic create_topic
|
@@ -126,12 +126,21 @@ module Google
|
|
126
126
|
|
127
127
|
##
|
128
128
|
# Creates the given topic with the given name.
|
129
|
-
def create_topic topic_name, labels: nil, kms_key_name: nil,
|
129
|
+
def create_topic topic_name, labels: nil, kms_key_name: nil,
|
130
|
+
persistence_regions: nil, options: {}
|
131
|
+
if persistence_regions
|
132
|
+
message_storage_policy = {
|
133
|
+
allowed_persistence_regions: Array(persistence_regions)
|
134
|
+
}
|
135
|
+
end
|
136
|
+
|
130
137
|
execute do
|
131
|
-
publisher.create_topic
|
132
|
-
|
133
|
-
|
134
|
-
|
138
|
+
publisher.create_topic \
|
139
|
+
topic_path(topic_name, options),
|
140
|
+
labels: labels,
|
141
|
+
kms_key_name: kms_key_name,
|
142
|
+
message_storage_policy: message_storage_policy,
|
143
|
+
options: default_options
|
135
144
|
end
|
136
145
|
end
|
137
146
|
|
@@ -48,7 +48,7 @@ module Google
|
|
48
48
|
@pause_cond = new_cond
|
49
49
|
|
50
50
|
@inventory = Inventory.new self, @subscriber.stream_inventory
|
51
|
-
@callback_thread_pool = Concurrent::
|
51
|
+
@callback_thread_pool = Concurrent::ThreadPoolExecutor.new \
|
52
52
|
max_threads: @subscriber.callback_threads
|
53
53
|
|
54
54
|
@stream_keepalive_task = Concurrent::TimerTask.new(
|
@@ -212,6 +212,30 @@ module Google
|
|
212
212
|
Array @grpc.message_storage_policy.allowed_persistence_regions
|
213
213
|
end
|
214
214
|
|
215
|
+
##
|
216
|
+
# Sets the list of GCP region IDs where messages that are published to
|
217
|
+
# the topic may be persisted in storage.
|
218
|
+
#
|
219
|
+
# @param [Array<String>] new_persistence_regions
|
220
|
+
#
|
221
|
+
# @example
|
222
|
+
# require "google/cloud/pubsub"
|
223
|
+
#
|
224
|
+
# pubsub = Google::Cloud::PubSub.new
|
225
|
+
#
|
226
|
+
# topic = pubsub.topic "my-topic"
|
227
|
+
#
|
228
|
+
# topic.persistence_regions = ["us-central1", "us-central2"]
|
229
|
+
#
|
230
|
+
def persistence_regions= new_persistence_regions
|
231
|
+
update_grpc = Google::Cloud::PubSub::V1::Topic.new \
|
232
|
+
name: name, message_storage_policy: {
|
233
|
+
allowed_persistence_regions: Array(new_persistence_regions)
|
234
|
+
}
|
235
|
+
@grpc = service.update_topic update_grpc, :message_storage_policy
|
236
|
+
@resource_name = nil
|
237
|
+
end
|
238
|
+
|
215
239
|
##
|
216
240
|
# Permanently deletes the topic.
|
217
241
|
#
|
data/lib/google/cloud/pubsub.rb
CHANGED
@@ -111,6 +111,7 @@ module Google
|
|
111
111
|
PubSub::Project.new(
|
112
112
|
PubSub::Service.new(
|
113
113
|
project_id, credentials, timeout: timeout,
|
114
|
+
host: configure.endpoint,
|
114
115
|
client_config: client_config
|
115
116
|
)
|
116
117
|
)
|
@@ -136,6 +137,8 @@ module Google
|
|
136
137
|
# * `timeout` - (Integer) Default timeout to use in requests.
|
137
138
|
# * `client_config` - (Hash) A hash of values to override the default
|
138
139
|
# behavior of the API client.
|
140
|
+
# * `endpoint` - (String) Override of the endpoint host name, or `nil`
|
141
|
+
# to use the default endpoint.
|
139
142
|
# * `emulator_host` - (String) Host name of the emulator. Defaults to
|
140
143
|
# `ENV["PUBSUB_EMULATOR_HOST"]`
|
141
144
|
# * `on_error` - (Proc) A Proc to be run when an error is encountered
|
data/lib/google-cloud-pubsub.rb
CHANGED
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.
|
4
|
+
version: 0.38.0
|
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-
|
12
|
+
date: 2019-08-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-cloud-core
|
@@ -306,7 +306,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
306
306
|
- !ruby/object:Gem::Version
|
307
307
|
version: '0'
|
308
308
|
requirements: []
|
309
|
-
rubygems_version: 3.0.
|
309
|
+
rubygems_version: 3.0.4
|
310
310
|
signing_key:
|
311
311
|
specification_version: 4
|
312
312
|
summary: API Client library for Google Cloud Pub/Sub
|