cotton-tail 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.circleci/config.yml +2 -2
- data/.rspec +1 -2
- data/.ruby-version +1 -1
- data/Gemfile.lock +9 -2
- data/cotton-tail.gemspec +2 -0
- data/lib/cotton_tail/app.rb +1 -6
- data/lib/cotton_tail/dsl/routes.rb +3 -3
- data/lib/cotton_tail/queue/bunny.rb +10 -7
- data/lib/cotton_tail/version.rb +1 -1
- metadata +31 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 59a0b8fe6472fc78f13f5347a249a85118ec1df3e1274b13e31a32f79aafd290
|
|
4
|
+
data.tar.gz: 7db834f63293c4bb811dbff278a2dec964e1b55317476e2b2819852bafc9217b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 44fe3a5e0a10a005dc7ded35338770324d1f487cc411d61975023b05a30bdbbeae5a6c759195cf577c5d055b2a5d395b2067088aea4abdc120d25980bab7be94
|
|
7
|
+
data.tar.gz: 5fca20076db46c78e1c49b40da3725e8f5863d3c1165845699bb1f6167cd1fd0c86658ce567e26fcf1010868cc5c9054a71c90019a4a5927e783440cd3c2e7ff
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/.circleci/config.yml
CHANGED
|
@@ -44,7 +44,7 @@ jobs:
|
|
|
44
44
|
name: unit tests
|
|
45
45
|
command: |
|
|
46
46
|
mkdir /tmp/test-results
|
|
47
|
-
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
|
|
47
|
+
TEST_FILES="$(circleci tests glob "spec/unit/**/*_spec.rb" | circleci tests split --split-by=timings)"
|
|
48
48
|
|
|
49
49
|
bundle exec rspec --format progress \
|
|
50
50
|
--format RspecJunitFormatter \
|
|
@@ -55,7 +55,7 @@ jobs:
|
|
|
55
55
|
- run:
|
|
56
56
|
name: integration tests
|
|
57
57
|
command: |
|
|
58
|
-
TEST_FILES="$(circleci tests glob "integration/**/*_spec.rb" | circleci tests split --split-by=timings)"
|
|
58
|
+
TEST_FILES="$(circleci tests glob "spec/integration/**/*_spec.rb" | circleci tests split --split-by=timings)"
|
|
59
59
|
|
|
60
60
|
bundle exec rspec --format progress \
|
|
61
61
|
--format RspecJunitFormatter \
|
data/.rspec
CHANGED
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.6.0@cotton
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
cotton-tail (0.
|
|
4
|
+
cotton-tail (0.7.0)
|
|
5
5
|
bunny (~> 2.12)
|
|
6
6
|
ibsciss-middleware (~> 0.4.2)
|
|
7
7
|
|
|
@@ -14,6 +14,9 @@ GEM
|
|
|
14
14
|
benchmark-trend (0.2.0)
|
|
15
15
|
bunny (2.13.0)
|
|
16
16
|
amq-protocol (~> 2.3, >= 2.3.0)
|
|
17
|
+
debase (0.2.3.beta5)
|
|
18
|
+
debase-ruby_core_source (>= 0.10.2)
|
|
19
|
+
debase-ruby_core_source (0.10.4)
|
|
17
20
|
diff-lcs (1.3)
|
|
18
21
|
faraday (0.13.1)
|
|
19
22
|
multipart-post (>= 1.2, < 3)
|
|
@@ -65,6 +68,8 @@ GEM
|
|
|
65
68
|
rainbow (>= 2.2.2, < 4.0)
|
|
66
69
|
ruby-progressbar (~> 1.7)
|
|
67
70
|
unicode-display_width (~> 1.4.0)
|
|
71
|
+
ruby-debug-ide (0.7.0.beta7)
|
|
72
|
+
rake (>= 0.8.1)
|
|
68
73
|
ruby-progressbar (1.10.0)
|
|
69
74
|
unicode-display_width (1.4.1)
|
|
70
75
|
|
|
@@ -74,6 +79,7 @@ PLATFORMS
|
|
|
74
79
|
DEPENDENCIES
|
|
75
80
|
bundler (~> 1.16)
|
|
76
81
|
cotton-tail!
|
|
82
|
+
debase (= 0.2.3.beta5)
|
|
77
83
|
rabbitmq_http_api_client (~> 1.9)
|
|
78
84
|
rake (~> 12.0)
|
|
79
85
|
rspec (~> 3.0)
|
|
@@ -81,6 +87,7 @@ DEPENDENCIES
|
|
|
81
87
|
rspec-its (~> 1.2)
|
|
82
88
|
rspec_junit_formatter
|
|
83
89
|
rubocop (~> 0.60)
|
|
90
|
+
ruby-debug-ide (= 0.7.0.beta7)
|
|
84
91
|
|
|
85
92
|
BUNDLED WITH
|
|
86
|
-
1.17.
|
|
93
|
+
1.17.3
|
data/cotton-tail.gemspec
CHANGED
|
@@ -32,6 +32,7 @@ Gem::Specification.new do |spec|
|
|
|
32
32
|
spec.add_dependency 'ibsciss-middleware', '~> 0.4.2'
|
|
33
33
|
|
|
34
34
|
spec.add_development_dependency 'bundler', '~> 1.16'
|
|
35
|
+
spec.add_development_dependency 'debase', '0.2.3.beta5'
|
|
35
36
|
spec.add_development_dependency 'rabbitmq_http_api_client', '~> 1.9'
|
|
36
37
|
spec.add_development_dependency 'rake', '~> 12.0'
|
|
37
38
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
@@ -39,4 +40,5 @@ Gem::Specification.new do |spec|
|
|
|
39
40
|
spec.add_development_dependency 'rspec-its', '~> 1.2'
|
|
40
41
|
spec.add_development_dependency 'rspec_junit_formatter'
|
|
41
42
|
spec.add_development_dependency 'rubocop', '~> 0.60'
|
|
43
|
+
spec.add_development_dependency 'ruby-debug-ide', '0.7.0.beta7'
|
|
42
44
|
end
|
data/lib/cotton_tail/app.rb
CHANGED
|
@@ -19,11 +19,6 @@ module CottonTail
|
|
|
19
19
|
routes.queues
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
# Get a single message queue
|
|
23
|
-
def queue(name)
|
|
24
|
-
queues[name]
|
|
25
|
-
end
|
|
26
|
-
|
|
27
22
|
# Start the app, process all pending messages, and then shutdown
|
|
28
23
|
def run
|
|
29
24
|
supervisors.map(&:run).each(&:join)
|
|
@@ -43,7 +38,7 @@ module CottonTail
|
|
|
43
38
|
private
|
|
44
39
|
|
|
45
40
|
def supervisors
|
|
46
|
-
@supervisors ||= queues.map do |
|
|
41
|
+
@supervisors ||= queues.map do |queue|
|
|
47
42
|
Queue::Supervisor.new(queue, app: self)
|
|
48
43
|
end
|
|
49
44
|
end
|
|
@@ -10,7 +10,7 @@ module CottonTail
|
|
|
10
10
|
def initialize(queue_strategy:, connection:)
|
|
11
11
|
@queue_strategy = queue_strategy
|
|
12
12
|
@connection = connection
|
|
13
|
-
@queues =
|
|
13
|
+
@queues = []
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def draw(&block)
|
|
@@ -18,9 +18,9 @@ module CottonTail
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
# Define a new queue
|
|
21
|
-
def queue(name, **opts, &block)
|
|
21
|
+
def queue(name = '', **opts, &block)
|
|
22
22
|
@queue_strategy.call(name: name, connection: @connection, **opts).tap do |queue_instance|
|
|
23
|
-
@queues
|
|
23
|
+
@queues << queue_instance
|
|
24
24
|
queue_dsl = Queue.new(name, queue_instance, self)
|
|
25
25
|
queue_dsl.instance_eval(&block) if block_given?
|
|
26
26
|
end
|
|
@@ -8,8 +8,6 @@ module CottonTail
|
|
|
8
8
|
# A wrapper around a ::Bunny::Queue that makes it interchangeable with a
|
|
9
9
|
# standard Ruby Queue
|
|
10
10
|
class Bunny < SimpleDelegator
|
|
11
|
-
extend Forwardable
|
|
12
|
-
|
|
13
11
|
def self.call(**opts)
|
|
14
12
|
new(**opts)
|
|
15
13
|
end
|
|
@@ -17,9 +15,8 @@ module CottonTail
|
|
|
17
15
|
def initialize(name:, connection:, manual_ack: false, **opts)
|
|
18
16
|
super ::Queue.new
|
|
19
17
|
|
|
20
|
-
@name = name
|
|
21
|
-
@source_opts = opts
|
|
22
18
|
@connection = connection
|
|
19
|
+
@source = build_source(name, opts)
|
|
23
20
|
|
|
24
21
|
watch_source manual_ack
|
|
25
22
|
end
|
|
@@ -40,14 +37,20 @@ module CottonTail
|
|
|
40
37
|
|
|
41
38
|
private
|
|
42
39
|
|
|
43
|
-
attr_reader :connection
|
|
40
|
+
attr_reader :connection, :source
|
|
41
|
+
|
|
42
|
+
def nil_opts(opts)
|
|
43
|
+
{ exclusive: true }.merge(opts)
|
|
44
|
+
end
|
|
44
45
|
|
|
45
46
|
def watch_source(manual_ack)
|
|
46
47
|
source.subscribe(manual_ack: manual_ack) { |*args| self << args }
|
|
47
48
|
end
|
|
48
49
|
|
|
49
|
-
def
|
|
50
|
-
|
|
50
|
+
def build_source(name, opts)
|
|
51
|
+
return channel.queue('', **nil_opts(opts)) if name.nil?
|
|
52
|
+
|
|
53
|
+
channel.queue(name, **opts)
|
|
51
54
|
end
|
|
52
55
|
|
|
53
56
|
def channel
|
data/lib/cotton_tail/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cotton-tail
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Brennan
|
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
|
30
30
|
fXe/xr/Sc+2wCjHPVE2J+auN5hk3KCp1I4s2fKqyLIwyhTEF3shuYfCpC8rt/YdN
|
|
31
31
|
cy9/lg5LCI3OvakzxL4Xt1Sq4h/xJZ06ydTVJ1wxfk6BXHrg
|
|
32
32
|
-----END CERTIFICATE-----
|
|
33
|
-
date: 2019-
|
|
33
|
+
date: 2019-02-06 00:00:00.000000000 Z
|
|
34
34
|
dependencies:
|
|
35
35
|
- !ruby/object:Gem::Dependency
|
|
36
36
|
name: bunny
|
|
@@ -74,6 +74,20 @@ dependencies:
|
|
|
74
74
|
- - "~>"
|
|
75
75
|
- !ruby/object:Gem::Version
|
|
76
76
|
version: '1.16'
|
|
77
|
+
- !ruby/object:Gem::Dependency
|
|
78
|
+
name: debase
|
|
79
|
+
requirement: !ruby/object:Gem::Requirement
|
|
80
|
+
requirements:
|
|
81
|
+
- - '='
|
|
82
|
+
- !ruby/object:Gem::Version
|
|
83
|
+
version: 0.2.3.beta5
|
|
84
|
+
type: :development
|
|
85
|
+
prerelease: false
|
|
86
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
87
|
+
requirements:
|
|
88
|
+
- - '='
|
|
89
|
+
- !ruby/object:Gem::Version
|
|
90
|
+
version: 0.2.3.beta5
|
|
77
91
|
- !ruby/object:Gem::Dependency
|
|
78
92
|
name: rabbitmq_http_api_client
|
|
79
93
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -172,6 +186,20 @@ dependencies:
|
|
|
172
186
|
- - "~>"
|
|
173
187
|
- !ruby/object:Gem::Version
|
|
174
188
|
version: '0.60'
|
|
189
|
+
- !ruby/object:Gem::Dependency
|
|
190
|
+
name: ruby-debug-ide
|
|
191
|
+
requirement: !ruby/object:Gem::Requirement
|
|
192
|
+
requirements:
|
|
193
|
+
- - '='
|
|
194
|
+
- !ruby/object:Gem::Version
|
|
195
|
+
version: 0.7.0.beta7
|
|
196
|
+
type: :development
|
|
197
|
+
prerelease: false
|
|
198
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
199
|
+
requirements:
|
|
200
|
+
- - '='
|
|
201
|
+
- !ruby/object:Gem::Version
|
|
202
|
+
version: 0.7.0.beta7
|
|
175
203
|
description: |-
|
|
176
204
|
Simply and easily add AMQP messaging capabilities to
|
|
177
205
|
your services
|
|
@@ -244,8 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
244
272
|
- !ruby/object:Gem::Version
|
|
245
273
|
version: '0'
|
|
246
274
|
requirements: []
|
|
247
|
-
|
|
248
|
-
rubygems_version: 2.7.6
|
|
275
|
+
rubygems_version: 3.0.2
|
|
249
276
|
signing_key:
|
|
250
277
|
specification_version: 4
|
|
251
278
|
summary: A simple multi-threaded amqp server
|
metadata.gz.sig
CHANGED
|
Binary file
|