fastly_nsq 0.9.2 → 0.9.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: 969066c461be43f2864dc8bfd70ba8668cd1e86d
4
- data.tar.gz: e66bb9e002de48ea781de9ffdbec314224224480
3
+ metadata.gz: d135e4ea62368b96e679f326fc80985b2b4e33ed
4
+ data.tar.gz: 919c882bb3589ccab69c38c79a01317e0f4e5534
5
5
  SHA512:
6
- metadata.gz: 1ab5ab413df231d6066e73cbebb5ea3685fc3ffcc3fa1ec3b51dc2377c8392a9f6361c01179368ae370e4451fbd804e9c50115d00fe97d32353d0b4a1e96f9dc
7
- data.tar.gz: 94a2835acc738b23b58e40dd0c745c6214495ff6a8e1d013ac1ba8c7bf8765890050c4793f1559548243cc3c79ff933dbbd1988ee56ade25f255356ae6234532
6
+ metadata.gz: c818f9865a029c2940c8ef40849d708cdad1bc0b17222379ac7fddb67e08e0e89706f48c3f549a245971d3b3b04d684d3ffb03937d7da69776d1bd9cfbc69d26
7
+ data.tar.gz: 691bf6c75ab856a2a156fa846210520c9ea9f94957e28b98b1efb2ad426f79dabd01457a5f89b0ad533de479c505713c019ff9e1a4fd0a815820666c1694aa27
@@ -36,6 +36,10 @@ module FastlyNsq
36
36
  def initialize(topic:, nsqlookupd: nil, tls_v1: nil, tls_options: nil)
37
37
  end
38
38
 
39
+ def connected?
40
+ true
41
+ end
42
+
39
43
  def write(string)
40
44
  message = Message.new(string)
41
45
  queue.push(message)
@@ -10,6 +10,9 @@ module FastlyNsq
10
10
  @topic = topic
11
11
  @tls_options = TlsOptions.as_hash(tls_options)
12
12
  @connector = connector
13
+ Timeout.timeout(5) do
14
+ sleep(0.1) until connection.connected?
15
+ end
13
16
  end
14
17
 
15
18
  private
@@ -1,3 +1,3 @@
1
1
  module FastlyNsq
2
- VERSION = '0.9.2'.freeze
2
+ VERSION = '0.9.3'.freeze
3
3
  end
@@ -5,7 +5,7 @@ RSpec.describe FastlyNsq::Producer do
5
5
  let(:producer) { FastlyNsq::Producer.new(topic: topic) }
6
6
 
7
7
  describe 'when connector connects to a backend Producer' do
8
- let(:backend) { instance_double FastlyNsq::FakeBackend::Producer, write: nil, terminate: nil }
8
+ let(:backend) { instance_double FastlyNsq::FakeBackend::Producer, write: nil, terminate: nil, connected?: true }
9
9
  let(:connector) { double 'Connector', new: backend }
10
10
  let(:producer) do
11
11
  FastlyNsq::Producer.new topic: topic, connector: connector
@@ -33,6 +33,10 @@ RSpec.describe FastlyNsq::Producer do
33
33
  self
34
34
  end
35
35
 
36
+ def connected?
37
+ true
38
+ end
39
+
36
40
  def terminate
37
41
  raise 'Already terminated once' unless @@never_terminated
38
42
  @@never_terminated = false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastly_nsq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tommy O'Neil
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-01-17 00:00:00.000000000 Z
14
+ date: 2017-01-19 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: awesome_print