nsq-ruby 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -2
- data/lib/nsq/connection.rb +7 -5
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dc9c8d48a3ec617bbae37bb043f7450a8206ce1
|
4
|
+
data.tar.gz: 28111fd4130fd0173b978648e88c68793217976a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b01f2ffb835a61b597493da03b97e739e5991990bf715dfcf2711bcd5228c0335c6ef207a5678c88719e58397c19ab0b76800725037c2e42630409ebd3ef797d
|
7
|
+
data.tar.gz: 5659f9c7ae6e22223eabf9358e3f146fac66bd741945b8f914cd78c477d81f13d02a8e349a438c3b6085eb551540bcc9f81a008d92b5a6fb4a4b81980f44f9eb
|
data/README.md
CHANGED
@@ -102,7 +102,9 @@ producer = Nsq::Producer.new(
|
|
102
102
|
tls_v1: true,
|
103
103
|
tls_options: {
|
104
104
|
key: '/path/to/ssl/key.pem',
|
105
|
-
certificate: '/path/to/ssl/certificate.pem'
|
105
|
+
certificate: '/path/to/ssl/certificate.pem',
|
106
|
+
ca_certificate: '/path/to/ssl/ca_certificate.pem',
|
107
|
+
verify_mode: OpenSSL::SSL::VERIFY_PEER
|
106
108
|
}
|
107
109
|
)
|
108
110
|
```
|
@@ -200,7 +202,9 @@ consumer = Nsq::Consumer.new(
|
|
200
202
|
tls_v1: true,
|
201
203
|
tls_options: {
|
202
204
|
key: '/path/to/ssl/key.pem',
|
203
|
-
certificate: '/path/to/ssl/certificate.pem'
|
205
|
+
certificate: '/path/to/ssl/certificate.pem',
|
206
|
+
ca_certificate: '/path/to/ssl/ca_certificate.pem',
|
207
|
+
verify_mode: OpenSSL::SSL::VERIFY_PEER
|
204
208
|
}
|
205
209
|
)
|
206
210
|
```
|
data/lib/nsq/connection.rb
CHANGED
@@ -266,19 +266,20 @@ module Nsq
|
|
266
266
|
|
267
267
|
|
268
268
|
def stop_write_loop
|
269
|
-
@
|
270
|
-
|
269
|
+
if @write_loop_thread
|
270
|
+
@write_queue.push(:stop_write_loop)
|
271
|
+
@write_loop_thread.join
|
272
|
+
end
|
271
273
|
@write_loop_thread = nil
|
272
274
|
end
|
273
275
|
|
274
276
|
|
275
277
|
def write_loop
|
276
|
-
@stop_write_loop = false
|
277
278
|
data = nil
|
278
279
|
loop do
|
279
280
|
data = @write_queue.pop
|
281
|
+
break if data == :stop_write_loop
|
280
282
|
write_to_socket(data)
|
281
|
-
break if @stop_write_loop && @write_queue.size == 0
|
282
283
|
end
|
283
284
|
rescue Exception => ex
|
284
285
|
# requeue PUB and MPUB commands
|
@@ -383,8 +384,9 @@ module Nsq
|
|
383
384
|
context.cert = OpenSSL::X509::Certificate.new(File.read(@tls_options[:certificate]))
|
384
385
|
context.key = OpenSSL::PKey::RSA.new(File.read(@tls_options[:key]))
|
385
386
|
if @tls_options[:ca_certificate]
|
386
|
-
context.ca_file =
|
387
|
+
context.ca_file = @tls_options[:ca_certificate]
|
387
388
|
end
|
389
|
+
context.verify_mode = @tls_options[:verify_mode] || OpenSSL::SSL::VERIFY_NONE
|
388
390
|
context
|
389
391
|
end
|
390
392
|
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nsq-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wistia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|