freddy 2.5.1 → 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.lock +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 +2 -2
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.lock
CHANGED
@@ -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
|