freddy 2.5.0 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +16 -16
- data/freddy.gemspec +1 -1
- data/lib/freddy/consumers/respond_to_consumer.rb +2 -2
- data/lib/freddy/consumers/tap_into_consumer.rb +2 -2
- data/lib/freddy/version.rb +1 -1
- data/lib/freddy.rb +12 -8
- data/spec/freddy/freddy_spec.rb +1 -1
- data/spec/freddy/responder_handler_spec.rb +1 -1
- data/spec/integration/concurrency_spec.rb +3 -3
- data/spec/integration/reply_spec.rb +1 -1
- data/spec/integration/tap_into_with_group_spec.rb +3 -3
- data/spec/integration/tracing_spec.rb +5 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74c044f881fa44748647d92c0bb450755b69d3d1da6cbe23c87ff15e6724f415
|
4
|
+
data.tar.gz: f7b80d3bebfa4240727b1cdf1f6ef84449c3e91d5db1de81dd3a6a8cb4acc0df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba8c640285852bec4f9d318ccc8278137401152a14580be46a9ec281aca5bec6c7ca6cfd674161afd7124d0c936c103513acd14283cc24310cc03d2a1572d5f9
|
7
|
+
data.tar.gz: d4abff33f63da251866dc5fb9dce48a088738aa88dc70d0351bd2b633742d118d05bc8de02e5d2274da14bbbe15d225673e90870a885157334f4f5d47d77f704
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
freddy (2.
|
4
|
+
freddy (2.6.0)
|
5
5
|
bunny (~> 2.11)
|
6
6
|
concurrent-ruby (~> 1.0)
|
7
7
|
oj (~> 3.6)
|
8
|
-
opentelemetry-api (~> 1.0
|
8
|
+
opentelemetry-api (~> 1.0)
|
9
9
|
opentelemetry-semantic_conventions (~> 1.0)
|
10
10
|
zlib (~> 1.1)
|
11
11
|
|
@@ -23,19 +23,19 @@ GEM
|
|
23
23
|
hamster (3.0.0)
|
24
24
|
concurrent-ruby (~> 1.0)
|
25
25
|
method_source (1.0.0)
|
26
|
-
oj (3.13.
|
27
|
-
opentelemetry-api (1.
|
28
|
-
opentelemetry-common (0.19.
|
29
|
-
opentelemetry-api (~> 1.0
|
30
|
-
opentelemetry-
|
31
|
-
opentelemetry-api (~> 1.
|
32
|
-
opentelemetry-sdk (1.
|
33
|
-
opentelemetry-api (~> 1.
|
34
|
-
opentelemetry-common (~> 0.19.
|
35
|
-
opentelemetry-
|
26
|
+
oj (3.13.21)
|
27
|
+
opentelemetry-api (1.1.0)
|
28
|
+
opentelemetry-common (0.19.6)
|
29
|
+
opentelemetry-api (~> 1.0)
|
30
|
+
opentelemetry-registry (0.2.0)
|
31
|
+
opentelemetry-api (~> 1.1)
|
32
|
+
opentelemetry-sdk (1.2.0)
|
33
|
+
opentelemetry-api (~> 1.1)
|
34
|
+
opentelemetry-common (~> 0.19.3)
|
35
|
+
opentelemetry-registry (~> 0.2)
|
36
36
|
opentelemetry-semantic_conventions
|
37
|
-
opentelemetry-semantic_conventions (1.
|
38
|
-
opentelemetry-api (~> 1.0
|
37
|
+
opentelemetry-semantic_conventions (1.8.0)
|
38
|
+
opentelemetry-api (~> 1.0)
|
39
39
|
parallel (1.22.1)
|
40
40
|
parser (3.1.2.0)
|
41
41
|
ast (~> 2.4.1)
|
@@ -75,7 +75,7 @@ GEM
|
|
75
75
|
rubocop (~> 1.0)
|
76
76
|
rubocop-ast (>= 1.1.0)
|
77
77
|
ruby-progressbar (1.11.0)
|
78
|
-
set (1.0.
|
78
|
+
set (1.0.3)
|
79
79
|
sorted_set (1.0.3)
|
80
80
|
rbtree
|
81
81
|
set (~> 1.0)
|
@@ -90,7 +90,7 @@ DEPENDENCIES
|
|
90
90
|
bundler
|
91
91
|
freddy!
|
92
92
|
hamster (~> 3.0)
|
93
|
-
opentelemetry-sdk (~> 1.0
|
93
|
+
opentelemetry-sdk (~> 1.0)
|
94
94
|
pry
|
95
95
|
rake
|
96
96
|
rspec
|
data/freddy.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_dependency 'bunny', '~> 2.11'
|
24
24
|
spec.add_dependency 'concurrent-ruby', '~> 1.0'
|
25
25
|
spec.add_dependency 'oj', '~> 3.6'
|
26
|
-
spec.add_dependency 'opentelemetry-api', '~> 1.0
|
26
|
+
spec.add_dependency 'opentelemetry-api', '~> 1.0'
|
27
27
|
spec.add_dependency 'opentelemetry-semantic_conventions', '~> 1.0'
|
28
28
|
spec.add_dependency 'zlib', '~> 1.1'
|
29
29
|
end
|
@@ -3,8 +3,8 @@
|
|
3
3
|
class Freddy
|
4
4
|
module Consumers
|
5
5
|
class RespondToConsumer
|
6
|
-
def self.consume(
|
7
|
-
new(
|
6
|
+
def self.consume(**attrs, &block)
|
7
|
+
new(**attrs).consume(&block)
|
8
8
|
end
|
9
9
|
|
10
10
|
def initialize(thread_pool:, destination:, channel:, handler_adapter_factory:)
|
data/lib/freddy/version.rb
CHANGED
data/lib/freddy.rb
CHANGED
@@ -85,10 +85,12 @@ class Freddy
|
|
85
85
|
handler_adapter_factory = MessageHandlerAdapters::Factory.new(producer)
|
86
86
|
|
87
87
|
Consumers::RespondToConsumer.consume(
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
88
|
+
**{
|
89
|
+
thread_pool: Concurrent::FixedThreadPool.new(@prefetch_buffer_size),
|
90
|
+
destination: destination,
|
91
|
+
channel: channel,
|
92
|
+
handler_adapter_factory: handler_adapter_factory
|
93
|
+
},
|
92
94
|
&callback
|
93
95
|
)
|
94
96
|
end
|
@@ -128,10 +130,12 @@ class Freddy
|
|
128
130
|
@logger.debug "Tapping into messages that match #{pattern_or_patterns}"
|
129
131
|
|
130
132
|
Consumers::TapIntoConsumer.consume(
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
133
|
+
**{
|
134
|
+
thread_pool: Concurrent::FixedThreadPool.new(@prefetch_buffer_size),
|
135
|
+
patterns: Array(pattern_or_patterns),
|
136
|
+
channel: @connection.create_channel(prefetch: @prefetch_buffer_size),
|
137
|
+
options: options
|
138
|
+
},
|
135
139
|
&callback
|
136
140
|
)
|
137
141
|
end
|
data/spec/freddy/freddy_spec.rb
CHANGED
@@ -2,9 +2,9 @@ require 'spec_helper'
|
|
2
2
|
require 'hamster/experimental/mutable_set'
|
3
3
|
|
4
4
|
describe 'Concurrency' do
|
5
|
-
let(:freddy1) { Freddy.build(logger, config) }
|
6
|
-
let(:freddy2) { Freddy.build(logger, config) }
|
7
|
-
let(:freddy3) { Freddy.build(logger, config) }
|
5
|
+
let(:freddy1) { Freddy.build(logger, **config) }
|
6
|
+
let(:freddy2) { Freddy.build(logger, **config) }
|
7
|
+
let(:freddy3) { Freddy.build(logger, **config) }
|
8
8
|
|
9
9
|
after { [freddy1, freddy2, freddy3].each(&:close) }
|
10
10
|
|
@@ -2,9 +2,9 @@ require 'spec_helper'
|
|
2
2
|
require 'hamster/experimental/mutable_set'
|
3
3
|
|
4
4
|
describe 'Tapping into with group identifier' do
|
5
|
-
let(:deliverer) { Freddy.build(logger, config) }
|
6
|
-
let(:responder1) { Freddy.build(logger, config) }
|
7
|
-
let(:responder2) { Freddy.build(logger, config) }
|
5
|
+
let(:deliverer) { Freddy.build(logger, **config) }
|
6
|
+
let(:responder1) { Freddy.build(logger, **config) }
|
7
|
+
let(:responder2) { Freddy.build(logger, **config) }
|
8
8
|
|
9
9
|
let(:destination) { random_destination }
|
10
10
|
|
@@ -8,8 +8,8 @@ describe 'Tracing' do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
context 'when receiving a traced request' do
|
11
|
-
let(:freddy) { Freddy.build(logger, config) }
|
12
|
-
let(:freddy2) { Freddy.build(logger, config) }
|
11
|
+
let(:freddy) { Freddy.build(logger, **config) }
|
12
|
+
let(:freddy2) { Freddy.build(logger, **config) }
|
13
13
|
|
14
14
|
let(:destination) { random_destination }
|
15
15
|
let(:destination2) { random_destination }
|
@@ -63,9 +63,9 @@ describe 'Tracing' do
|
|
63
63
|
end
|
64
64
|
|
65
65
|
context 'when receiving a nested traced request' do
|
66
|
-
let(:freddy) { Freddy.build(logger, config) }
|
67
|
-
let(:freddy2) { Freddy.build(logger, config) }
|
68
|
-
let(:freddy3) { Freddy.build(logger, config) }
|
66
|
+
let(:freddy) { Freddy.build(logger, **config) }
|
67
|
+
let(:freddy2) { Freddy.build(logger, **config) }
|
68
|
+
let(:freddy3) { Freddy.build(logger, **config) }
|
69
69
|
|
70
70
|
let(:destination) { random_destination }
|
71
71
|
let(:destination2) { random_destination }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: freddy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Glia TechMovers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 1.0
|
89
|
+
version: '1.0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 1.0
|
96
|
+
version: '1.0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: opentelemetry-semantic_conventions
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|