fastly_nsq 0.13.2 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +5 -5
  2. data/.env +4 -0
  3. data/.overcommit.yml +3 -3
  4. data/.rubocop.yml +11 -1
  5. data/.travis.yml +8 -1
  6. data/Gemfile +9 -0
  7. data/README.md +52 -82
  8. data/Rakefile +2 -0
  9. data/bin/fastly_nsq +1 -0
  10. data/docker-compose.yml +23 -0
  11. data/examples/.sample.env +0 -3
  12. data/fastly_nsq.gemspec +7 -8
  13. data/lib/fastly_nsq.rb +44 -50
  14. data/lib/fastly_nsq/cli.rb +20 -14
  15. data/lib/fastly_nsq/consumer.rb +26 -30
  16. data/lib/fastly_nsq/feeder.rb +16 -0
  17. data/lib/fastly_nsq/http/nsqd.rb +7 -1
  18. data/lib/fastly_nsq/http/nsqlookupd.rb +1 -1
  19. data/lib/fastly_nsq/launcher.rb +31 -23
  20. data/lib/fastly_nsq/listener.rb +34 -103
  21. data/lib/fastly_nsq/manager.rb +48 -72
  22. data/lib/fastly_nsq/message.rb +2 -0
  23. data/lib/fastly_nsq/messenger.rb +5 -5
  24. data/lib/fastly_nsq/priority_queue.rb +12 -0
  25. data/lib/fastly_nsq/priority_thread_pool.rb +32 -0
  26. data/lib/fastly_nsq/producer.rb +52 -32
  27. data/lib/fastly_nsq/testing.rb +239 -0
  28. data/lib/fastly_nsq/tls_options.rb +2 -0
  29. data/lib/fastly_nsq/version.rb +3 -1
  30. data/spec/{lib/fastly_nsq/cli_spec.rb → cli_spec.rb} +2 -0
  31. data/spec/consumer_spec.rb +59 -0
  32. data/spec/fastly_nsq_spec.rb +72 -0
  33. data/spec/feeder_spec.rb +22 -0
  34. data/spec/{lib/fastly_nsq/http → http}/nsqd_spec.rb +1 -1
  35. data/spec/{lib/fastly_nsq/http → http}/nsqlookupd_spec.rb +1 -1
  36. data/spec/{lib/fastly_nsq/http_spec.rb → http_spec.rb} +3 -1
  37. data/spec/integration_spec.rb +48 -0
  38. data/spec/launcher_spec.rb +50 -0
  39. data/spec/listener_spec.rb +184 -0
  40. data/spec/manager_spec.rb +111 -0
  41. data/spec/matchers/delegate.rb +32 -0
  42. data/spec/{lib/fastly_nsq/message_spec.rb → message_spec.rb} +2 -0
  43. data/spec/{lib/fastly_nsq/messenger_spec.rb → messenger_spec.rb} +7 -5
  44. data/spec/priority_thread_pool_spec.rb +19 -0
  45. data/spec/producer_spec.rb +94 -0
  46. data/spec/spec_helper.rb +32 -28
  47. data/spec/support/http.rb +37 -0
  48. data/spec/support/webmock.rb +22 -0
  49. data/spec/{lib/fastly_nsq/tls_options_spec.rb → tls_options_spec.rb} +2 -0
  50. metadata +54 -96
  51. data/env_configuration_for_local_gem_tests.yml +0 -5
  52. data/example_config_class.rb +0 -20
  53. data/examples/Rakefile +0 -41
  54. data/lib/fastly_nsq/fake_backend.rb +0 -114
  55. data/lib/fastly_nsq/listener/config.rb +0 -35
  56. data/lib/fastly_nsq/rake_task.rb +0 -78
  57. data/lib/fastly_nsq/strategy.rb +0 -36
  58. data/spec/lib/fastly_nsq/consumer_spec.rb +0 -72
  59. data/spec/lib/fastly_nsq/fake_backend_spec.rb +0 -135
  60. data/spec/lib/fastly_nsq/fastly_nsq_spec.rb +0 -10
  61. data/spec/lib/fastly_nsq/launcher_spec.rb +0 -56
  62. data/spec/lib/fastly_nsq/listener_spec.rb +0 -213
  63. data/spec/lib/fastly_nsq/manager_spec.rb +0 -127
  64. data/spec/lib/fastly_nsq/producer_spec.rb +0 -60
  65. data/spec/lib/fastly_nsq/rake_task_spec.rb +0 -142
  66. data/spec/lib/fastly_nsq/strategy_spec.rb +0 -36
  67. data/spec/lib/fastly_nsq_spec.rb +0 -18
  68. data/spec/support/env_helpers.rb +0 -15
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec::Matchers.define :delegate do |method|
4
+ match do |delegator|
5
+ @method = @prefix ? :"#{@to}_#{method}" : method
6
+ @delegator = delegator
7
+ begin
8
+ @delegator.send(@to)
9
+ rescue NoMethodError
10
+ raise "#{@delegator} does not respond to #{@to}!"
11
+ end
12
+ allow(@delegator).to receive(@to).and_return(double('receiver', method => :called))
13
+ actual = (@delegator.send(@method) == :called)
14
+ allow(@delegator).to receive(@to).and_call_original # unstub
15
+ actual
16
+ end
17
+
18
+ description do
19
+ "delegate :#{@method} to its #{@to}#{@prefix ? ' with prefix' : ''}"
20
+ end
21
+
22
+ failure_message do |_text|
23
+ "expected #{@delegator} to delegate :#{@method} to its #{@to}#{@prefix ? ' with prefix' : ''}"
24
+ end
25
+
26
+ failure_message_when_negated do |_text|
27
+ "expected #{@delegator} not to delegate :#{@method} to its #{@to}#{@prefix ? ' with prefix' : ''}"
28
+ end
29
+
30
+ chain(:to) { |receiver| @to = receiver }
31
+ chain(:with_prefix) { @prefix = true }
32
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
  require 'json'
3
5
 
@@ -1,4 +1,6 @@
1
1
 
2
+ # frozen_string_literal: true
3
+
2
4
  require 'spec_helper'
3
5
  require 'json'
4
6
 
@@ -26,7 +28,7 @@ RSpec.describe FastlyNsq::Messenger do
26
28
  it 'writes a single message on a producer' do
27
29
  subject.producers['topic'] = producer
28
30
 
29
- subject.deliver message: message, on_topic: 'topic', originating_service: origin
31
+ subject.deliver message: message, topic: 'topic', originating_service: origin
30
32
 
31
33
  expect(producer).to have_received(:write).with(expected_attributes.to_json)
32
34
  end
@@ -35,7 +37,7 @@ RSpec.describe FastlyNsq::Messenger do
35
37
  subject.producers['topic'] = producer
36
38
  expected_attributes[:meta][:originating_service] = 'Unknown'
37
39
 
38
- subject.deliver message: message, on_topic: 'topic'
40
+ subject.deliver message: message, topic: 'topic'
39
41
 
40
42
  expect(producer).to have_received(:write).with(expected_attributes.to_json)
41
43
  end
@@ -47,7 +49,7 @@ RSpec.describe FastlyNsq::Messenger do
47
49
 
48
50
  subject.producers['topic'] = producer
49
51
 
50
- subject.deliver message: message, on_topic: 'topic', meta: meta, originating_service: origin
52
+ subject.deliver message: message, topic: 'topic', meta: meta, originating_service: origin
51
53
 
52
54
  expect(producer).to have_received(:write).with(expected_attributes.to_json)
53
55
  end
@@ -61,7 +63,7 @@ RSpec.describe FastlyNsq::Messenger do
61
63
 
62
64
  subject.producers['topic'] = producer
63
65
 
64
- subject.deliver message: message, on_topic: 'topic', meta: meta, originating_service: origin
66
+ subject.deliver message: message, topic: 'topic', meta: meta, originating_service: origin
65
67
 
66
68
  expect(producer).to have_received(:write).with(expected_attributes.to_json)
67
69
  end
@@ -74,7 +76,7 @@ RSpec.describe FastlyNsq::Messenger do
74
76
  subject.originating_service = service
75
77
  expected_attributes[:meta][:originating_service] = service
76
78
 
77
- subject.deliver message: message, on_topic: 'nanotopic'
79
+ subject.deliver message: message, topic: 'nanotopic'
78
80
 
79
81
  expect(producer).to have_received(:write).with(expected_attributes.to_json)
80
82
 
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe FastlyNsq::PriorityThreadPool do
6
+ let!(:pool) { described_class.new(max_threads: 1) }
7
+
8
+ after { pool.shutdown || pool.wait_for_termination }
9
+
10
+ it 'executes work based on supplied priority' do
11
+ actual = []
12
+ count = 10
13
+ count.times { |i| pool.post(i) { actual << i } }
14
+ expect { pool.completed_task_count }.to eventually(eq(count)).within(30)
15
+
16
+ # weak but stable assertion that the last element was not the last processed
17
+ expect(actual.last).not_to eq(count - 1)
18
+ end
19
+ end
@@ -0,0 +1,94 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe FastlyNsq::Producer do
6
+ let!(:topic) { 'fnsq' }
7
+ subject { FastlyNsq::Producer.new(topic: topic) }
8
+
9
+ before { reset_topic(topic) }
10
+ before { expect { subject }.to eventually(be_connected).within(5) }
11
+ after { subject.terminate if subject.connected? }
12
+
13
+ it { should be_connected }
14
+
15
+ it 'writes a message' do
16
+ subject.write 'foo'
17
+ expect { message_count(topic) }.to eventually(eq(1)).within(5)
18
+ end
19
+
20
+ it 'should terminate' do
21
+ expect { subject.terminate }.to change(subject, :connected?).to(false)
22
+ expect(subject.connection).to eq(nil)
23
+ end
24
+
25
+ it 'does not write after termination' do
26
+ subject.terminate
27
+ expect { subject.write 'foo' }.to raise_error(FastlyNsq::NotConnectedError)
28
+ end
29
+
30
+ it 'can connect after termination' do
31
+ subject.terminate
32
+ expect { subject.connect }.to change(subject, :connected?).to(true)
33
+ end
34
+
35
+ it 'raises when connection fails within the specified timeframe' do
36
+ allow_any_instance_of(Nsq::Producer).to receive(:connected?).and_return(false)
37
+ logger = spy('logger')
38
+ expect(logger).to receive(:error).and_return("Producer for #{topic} failed to connect!")
39
+
40
+ if RUBY_VERSION > '2.4.0'
41
+ expect { FastlyNsq::Producer.new(topic: topic, logger: logger, connect_timeout: 0.2) }.
42
+ to raise_error(FastlyNsq::ConnectionFailed, match(FastlyNsq.lookupd_http_addresses.inspect))
43
+ else
44
+ expect { FastlyNsq::Producer.new(topic: topic, logger: logger, connect_timeout: 0.2) }.
45
+ to raise_error(FastlyNsq::ConnectionFailed)
46
+ end
47
+ end
48
+
49
+ describe 'faking', :fake do
50
+ it { should be_connected }
51
+
52
+ it 'should terminate' do
53
+ expect { subject.terminate }.to change(subject, :connected?).to(false)
54
+ expect(subject.connection).to eq(nil)
55
+ end
56
+
57
+ it 'writes a message' do
58
+ expect { subject.write 'foo' }.to change { subject.messages.size }.by(1)
59
+ end
60
+
61
+ it 'does not write after termination' do
62
+ subject.terminate
63
+ expect { subject.write 'foo' }.to raise_error(FastlyNsq::NotConnectedError)
64
+ end
65
+
66
+ it 'can connect after termination' do
67
+ subject.terminate
68
+ expect { subject.connect }.to change(subject, :connected?).to(true)
69
+ end
70
+ end
71
+
72
+ describe 'inline', :inline do
73
+ it { should be_connected }
74
+
75
+ it 'should terminate' do
76
+ expect { subject.terminate }.to change(subject, :connected?).to(false)
77
+ expect(subject.connection).to eq(nil)
78
+ end
79
+
80
+ it 'writes a message' do
81
+ expect { subject.write 'foo' }.to change { subject.messages.size }.by(1)
82
+ end
83
+
84
+ it 'does not write after termination' do
85
+ subject.terminate
86
+ expect { subject.write 'foo' }.to raise_error(FastlyNsq::NotConnectedError)
87
+ end
88
+
89
+ it 'can connect after termination' do
90
+ subject.terminate
91
+ expect { subject.connect }.to change(subject, :connected?).to(true)
92
+ end
93
+ end
94
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,9 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'dotenv'
4
+ Dotenv.load
5
+
6
+ require 'bundler/setup'
7
+
8
+ Bundler.require(:development)
9
+
1
10
  require 'fastly_nsq'
2
- require 'awesome_print'
3
- require 'pry-byebug'
4
- require 'webmock/rspec'
11
+ require 'fastly_nsq/http'
12
+ require 'fastly_nsq/testing'
5
13
 
6
- require_relative 'support/env_helpers'
14
+ Dir[File.expand_path('../{support,shared,matchers}/**/*.rb', __FILE__)].each { |f| require(f) }
15
+
16
+ FastlyNsq::Testing.disable!
17
+
18
+ if ENV['DEBUG']
19
+ Concurrent.use_stdlib_logger(Logger::DEBUG)
20
+ FastlyNsq.logger = Logger.new(STDOUT)
21
+ else
22
+ Concurrent.use_stdlib_logger(Logger::ERROR)
23
+ FastlyNsq.logger = Logger.new(STDOUT).tap { |l| l.level = Logger::ERROR }
24
+ end
7
25
 
8
26
  RSpec.configure do |config|
9
27
  config.expect_with :rspec do |expectations|
@@ -22,38 +40,24 @@ RSpec.configure do |config|
22
40
  config.profile_examples = 1
23
41
  config.run_all_when_everything_filtered = true
24
42
  Kernel.srand config.seed
43
+ config.default_formatter = 'doc' if config.files_to_run.one?
25
44
 
26
- if config.files_to_run.one?
27
- config.default_formatter = 'doc'
28
- end
29
-
30
- config.before(:each) do
31
- load_sample_environment_variables
32
- FastlyNsq::FakeBackend.reset!
33
- WebMock.reset!
34
- end
35
-
36
- config.around(:each, fake_queue: true) do |example|
45
+ config.around(:each, fake: true) do |example|
37
46
  RSpec::Mocks.with_temporary_scope do
38
- use_fake_connection do
39
- example.run
40
- end
47
+ FastlyNsq::Messages.messages.clear
48
+ FastlyNsq::Testing.fake! { example.run }
41
49
  end
42
50
  end
43
51
 
44
- config.around(:each, fake_queue: false) do |example|
52
+ config.around(:each, inline: true) do |example|
45
53
  RSpec::Mocks.with_temporary_scope do
46
- use_real_connection do
47
- example.run
48
- end
54
+ FastlyNsq::Testing.inline! { example.run }
49
55
  end
50
56
  end
51
57
 
52
- def load_sample_environment_variables
53
- env_file = File.open('env_configuration_for_local_gem_tests.yml')
54
-
55
- YAML.safe_load(env_file).each do |key, value|
56
- ENV[key.to_s] = value
57
- end
58
+ config.before(:each) do
59
+ FastlyNsq.manager.terminate(1)
60
+ FastlyNsq.manager = FastlyNsq::Manager.new
61
+ FastlyNsq::Testing.reset!
58
62
  end
59
63
  end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SupportHttp
4
+ def message_count(topic)
5
+ topic_stats = JSON.parse(FastlyNsq::Http::Nsqd.stats(topic: topic).body)['topics'].first || {}
6
+ topic_stats['message_count']
7
+ end
8
+
9
+ def create_topic(topic)
10
+ FastlyNsq::Http::Nsqd.topic_create(topic: topic).code == 200
11
+ end
12
+
13
+ def empty_topic(topic)
14
+ FastlyNsq::Http::Nsqd.topic_empty(topic: topic).code == 200
15
+ end
16
+
17
+ def delete_topic(topic)
18
+ FastlyNsq::Http::Nsqd.topic_delete(topic: topic).code == 200
19
+ end
20
+
21
+ def delete_channel(topic, channel)
22
+ FastlyNsq::Http::Nsqd.channel_delete(topic: topic, channel: channel).code == 200
23
+ end
24
+
25
+ def create_channel(topic, channel)
26
+ FastlyNsq::Http::Nsqd.channel_create(topic: topic, channel: channel).code == 200
27
+ end
28
+
29
+ def reset_topic(topic, channel: nil)
30
+ delete_channel(topic, channel) if channel
31
+ delete_topic(topic)
32
+ create_topic(topic)
33
+ create_channel(topic, channel) if channel
34
+ end
35
+ end
36
+
37
+ RSpec.configure { |config| config.include(SupportHttp) }
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'webmock/rspec/matchers'
4
+
5
+ RSpec.configure do |config|
6
+ config.include WebMock::API, :webmock
7
+ config.include WebMock::Matchers, :webmock
8
+
9
+ config.before(:each, :webmock) do
10
+ WebMock.enable!
11
+ end
12
+
13
+ config.after(:each, :webmock) do
14
+ WebMock.disable!
15
+ end
16
+
17
+ config.after(:each) do
18
+ WebMock.reset!
19
+ end
20
+ end
21
+
22
+ WebMock::AssertionFailure.error_class = RSpec::Expectations::ExpectationNotMetError
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  RSpec.describe FastlyNsq::TlsOptions do
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.13.2
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tommy O'Neil
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2017-12-04 00:00:00.000000000 Z
16
+ date: 2018-01-05 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: awesome_print
@@ -43,20 +43,6 @@ dependencies:
43
43
  - - "~>"
44
44
  - !ruby/object:Gem::Version
45
45
  version: '1.12'
46
- - !ruby/object:Gem::Dependency
47
- name: bundler-audit
48
- requirement: !ruby/object:Gem::Requirement
49
- requirements:
50
- - - "~>"
51
- - !ruby/object:Gem::Version
52
- version: 0.5.0
53
- type: :development
54
- prerelease: false
55
- version_requirements: !ruby/object:Gem::Requirement
56
- requirements:
57
- - - "~>"
58
- - !ruby/object:Gem::Version
59
- version: 0.5.0
60
46
  - !ruby/object:Gem::Dependency
61
47
  name: dotenv
62
48
  requirement: !ruby/object:Gem::Requirement
@@ -71,20 +57,6 @@ dependencies:
71
57
  - - ">="
72
58
  - !ruby/object:Gem::Version
73
59
  version: '0'
74
- - !ruby/object:Gem::Dependency
75
- name: overcommit
76
- requirement: !ruby/object:Gem::Requirement
77
- requirements:
78
- - - "~>"
79
- - !ruby/object:Gem::Version
80
- version: 0.32.0
81
- type: :development
82
- prerelease: false
83
- version_requirements: !ruby/object:Gem::Requirement
84
- requirements:
85
- - - "~>"
86
- - !ruby/object:Gem::Version
87
- version: 0.32.0
88
60
  - !ruby/object:Gem::Dependency
89
61
  name: pry-byebug
90
62
  requirement: !ruby/object:Gem::Requirement
@@ -100,109 +72,95 @@ dependencies:
100
72
  - !ruby/object:Gem::Version
101
73
  version: '3.3'
102
74
  - !ruby/object:Gem::Dependency
103
- name: rake
75
+ name: rspec
104
76
  requirement: !ruby/object:Gem::Requirement
105
77
  requirements:
106
78
  - - "~>"
107
79
  - !ruby/object:Gem::Version
108
- version: 11.1.2
80
+ version: '3.4'
109
81
  type: :development
110
82
  prerelease: false
111
83
  version_requirements: !ruby/object:Gem::Requirement
112
84
  requirements:
113
85
  - - "~>"
114
86
  - !ruby/object:Gem::Version
115
- version: 11.1.2
87
+ version: '3.4'
116
88
  - !ruby/object:Gem::Dependency
117
- name: rdoc
89
+ name: rspec-eventually
118
90
  requirement: !ruby/object:Gem::Requirement
119
91
  requirements:
120
- - - "~>"
92
+ - - '='
121
93
  - !ruby/object:Gem::Version
122
- version: 4.2.2
94
+ version: '0.2'
123
95
  type: :development
124
96
  prerelease: false
125
97
  version_requirements: !ruby/object:Gem::Requirement
126
98
  requirements:
127
- - - "~>"
99
+ - - '='
128
100
  - !ruby/object:Gem::Version
129
- version: 4.2.2
101
+ version: '0.2'
130
102
  - !ruby/object:Gem::Dependency
131
- name: rspec
103
+ name: webmock
132
104
  requirement: !ruby/object:Gem::Requirement
133
105
  requirements:
134
106
  - - "~>"
135
107
  - !ruby/object:Gem::Version
136
- version: 3.4.0
108
+ version: '3.0'
137
109
  type: :development
138
110
  prerelease: false
139
111
  version_requirements: !ruby/object:Gem::Requirement
140
112
  requirements:
141
113
  - - "~>"
142
114
  - !ruby/object:Gem::Version
143
- version: 3.4.0
115
+ version: '3.0'
144
116
  - !ruby/object:Gem::Dependency
145
- name: rubocop
117
+ name: concurrent-ruby
146
118
  requirement: !ruby/object:Gem::Requirement
147
119
  requirements:
148
120
  - - "~>"
149
121
  - !ruby/object:Gem::Version
150
- version: 0.51.0
151
- type: :development
122
+ version: '1.0'
123
+ type: :runtime
152
124
  prerelease: false
153
125
  version_requirements: !ruby/object:Gem::Requirement
154
126
  requirements:
155
127
  - - "~>"
156
128
  - !ruby/object:Gem::Version
157
- version: 0.51.0
129
+ version: '1.0'
158
130
  - !ruby/object:Gem::Dependency
159
- name: rubygems-tasks
131
+ name: nsq-ruby
160
132
  requirement: !ruby/object:Gem::Requirement
161
133
  requirements:
162
134
  - - "~>"
163
135
  - !ruby/object:Gem::Version
164
- version: '0.2'
165
- type: :development
166
- prerelease: false
167
- version_requirements: !ruby/object:Gem::Requirement
168
- requirements:
169
- - - "~>"
170
- - !ruby/object:Gem::Version
171
- version: '0.2'
172
- - !ruby/object:Gem::Dependency
173
- name: webmock
174
- requirement: !ruby/object:Gem::Requirement
175
- requirements:
136
+ version: '2.0'
176
137
  - - ">="
177
138
  - !ruby/object:Gem::Version
178
- version: '0'
179
- type: :development
139
+ version: 2.0.5
140
+ type: :runtime
180
141
  prerelease: false
181
142
  version_requirements: !ruby/object:Gem::Requirement
182
143
  requirements:
144
+ - - "~>"
145
+ - !ruby/object:Gem::Version
146
+ version: '2.0'
183
147
  - - ">="
184
148
  - !ruby/object:Gem::Version
185
- version: '0'
149
+ version: 2.0.5
186
150
  - !ruby/object:Gem::Dependency
187
- name: nsq-ruby
151
+ name: priority_queue_cxx
188
152
  requirement: !ruby/object:Gem::Requirement
189
153
  requirements:
190
154
  - - "~>"
191
155
  - !ruby/object:Gem::Version
192
- version: '2.0'
193
- - - ">="
194
- - !ruby/object:Gem::Version
195
- version: 2.0.5
156
+ version: '0.3'
196
157
  type: :runtime
197
158
  prerelease: false
198
159
  version_requirements: !ruby/object:Gem::Requirement
199
160
  requirements:
200
161
  - - "~>"
201
162
  - !ruby/object:Gem::Version
202
- version: '2.0'
203
- - - ">="
204
- - !ruby/object:Gem::Version
205
- version: 2.0.5
163
+ version: '0.3'
206
164
  description: Helper classes for Fastly's NSQ Services
207
165
  email: tommy@fastly.com
208
166
  executables:
@@ -211,6 +169,7 @@ extensions: []
211
169
  extra_rdoc_files: []
212
170
  files:
213
171
  - ".document"
172
+ - ".env"
214
173
  - ".github/PULL_REQUEST_TEMPLATE.md"
215
174
  - ".gitignore"
216
175
  - ".overcommit.yml"
@@ -224,49 +183,48 @@ files:
224
183
  - README.md
225
184
  - Rakefile
226
185
  - bin/fastly_nsq
227
- - env_configuration_for_local_gem_tests.yml
228
- - example_config_class.rb
186
+ - docker-compose.yml
229
187
  - examples/.sample.env
230
- - examples/Rakefile
231
188
  - fastly_nsq.gemspec
232
189
  - lib/fastly_nsq.rb
233
190
  - lib/fastly_nsq/cli.rb
234
191
  - lib/fastly_nsq/consumer.rb
235
- - lib/fastly_nsq/fake_backend.rb
192
+ - lib/fastly_nsq/feeder.rb
236
193
  - lib/fastly_nsq/http.rb
237
194
  - lib/fastly_nsq/http/nsqd.rb
238
195
  - lib/fastly_nsq/http/nsqlookupd.rb
239
196
  - lib/fastly_nsq/launcher.rb
240
197
  - lib/fastly_nsq/listener.rb
241
- - lib/fastly_nsq/listener/config.rb
242
198
  - lib/fastly_nsq/manager.rb
243
199
  - lib/fastly_nsq/message.rb
244
200
  - lib/fastly_nsq/messenger.rb
201
+ - lib/fastly_nsq/priority_queue.rb
202
+ - lib/fastly_nsq/priority_thread_pool.rb
245
203
  - lib/fastly_nsq/producer.rb
246
- - lib/fastly_nsq/rake_task.rb
247
204
  - lib/fastly_nsq/safe_thread.rb
248
- - lib/fastly_nsq/strategy.rb
205
+ - lib/fastly_nsq/testing.rb
249
206
  - lib/fastly_nsq/tls_options.rb
250
207
  - lib/fastly_nsq/version.rb
251
- - spec/lib/fastly_nsq/cli_spec.rb
252
- - spec/lib/fastly_nsq/consumer_spec.rb
253
- - spec/lib/fastly_nsq/fake_backend_spec.rb
254
- - spec/lib/fastly_nsq/fastly_nsq_spec.rb
255
- - spec/lib/fastly_nsq/http/nsqd_spec.rb
256
- - spec/lib/fastly_nsq/http/nsqlookupd_spec.rb
257
- - spec/lib/fastly_nsq/http_spec.rb
258
- - spec/lib/fastly_nsq/launcher_spec.rb
259
- - spec/lib/fastly_nsq/listener_spec.rb
260
- - spec/lib/fastly_nsq/manager_spec.rb
261
- - spec/lib/fastly_nsq/message_spec.rb
262
- - spec/lib/fastly_nsq/messenger_spec.rb
263
- - spec/lib/fastly_nsq/producer_spec.rb
264
- - spec/lib/fastly_nsq/rake_task_spec.rb
265
- - spec/lib/fastly_nsq/strategy_spec.rb
266
- - spec/lib/fastly_nsq/tls_options_spec.rb
267
- - spec/lib/fastly_nsq_spec.rb
208
+ - spec/cli_spec.rb
209
+ - spec/consumer_spec.rb
210
+ - spec/fastly_nsq_spec.rb
211
+ - spec/feeder_spec.rb
212
+ - spec/http/nsqd_spec.rb
213
+ - spec/http/nsqlookupd_spec.rb
214
+ - spec/http_spec.rb
215
+ - spec/integration_spec.rb
216
+ - spec/launcher_spec.rb
217
+ - spec/listener_spec.rb
218
+ - spec/manager_spec.rb
219
+ - spec/matchers/delegate.rb
220
+ - spec/message_spec.rb
221
+ - spec/messenger_spec.rb
222
+ - spec/priority_thread_pool_spec.rb
223
+ - spec/producer_spec.rb
268
224
  - spec/spec_helper.rb
269
- - spec/support/env_helpers.rb
225
+ - spec/support/http.rb
226
+ - spec/support/webmock.rb
227
+ - spec/tls_options_spec.rb
270
228
  homepage: https://github.com/fastly/fastly_nsq
271
229
  licenses:
272
230
  - MIT
@@ -287,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
287
245
  version: '0'
288
246
  requirements: []
289
247
  rubyforge_project:
290
- rubygems_version: 2.5.1
248
+ rubygems_version: 2.7.3
291
249
  signing_key:
292
250
  specification_version: 4
293
251
  summary: Fastly NSQ Adapter