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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 784760540970f7a72dc0e168f3727221b82ca214
4
- data.tar.gz: 533cfa8fd3dadb9dde8c6ee25aff6ef6eac8d50c
3
+ metadata.gz: 9dc9c8d48a3ec617bbae37bb043f7450a8206ce1
4
+ data.tar.gz: 28111fd4130fd0173b978648e88c68793217976a
5
5
  SHA512:
6
- metadata.gz: f0298fa85dd7a438539770e5e3d14c5f96d0003892c28ac675fd62042cdf80c712c35cefa8d78d52d432659e9d0432a737daa44197f257c273ea281c384f6f9e
7
- data.tar.gz: 5abe4bde5bbacb4a9ccb96efc948370afd9902094ce4432d762dffd62fbfab78b28ee6445869c5789f03d5ca888396b7b8b49d0fd1a5bdb0596c73461f03d97a
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
  ```
@@ -266,19 +266,20 @@ module Nsq
266
266
 
267
267
 
268
268
  def stop_write_loop
269
- @stop_write_loop = true
270
- @write_loop_thread.join(1) if @write_loop_thread
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 = OpenSSL::X509::Certificate.new(File.read(@tls_options[:ca_certificate])).to_pem
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
@@ -2,7 +2,7 @@ module Nsq
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 0
5
- PATCH = 2
5
+ PATCH = 3
6
6
  BUILD = nil
7
7
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
8
8
  end
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.2
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-10-20 00:00:00.000000000 Z
11
+ date: 2016-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler