lex-mesh 0.4.5 → 0.4.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0bd1055e60b5e6c6d2e63c08f7aab32c7f03b294b8251da6b583516060e3fdec
4
- data.tar.gz: aaee0b1ecd57d2e8673706de83ac842476b5aba0570a38ab57bce3ca6c17cee7
3
+ metadata.gz: 5e748e565682b21ecca099dff05a5192840b124d01697a572dcb34e4fd8ddf4b
4
+ data.tar.gz: 01ba8a7a0c658ef92be7bd39faa85e3d616e9b65ff8a05f8eb476816877a5e03
5
5
  SHA512:
6
- metadata.gz: 7e350395459a7499684bdc844fbd81b4a628f58e2656c2d68031e4ac3688ad954be2486e83023dbe54d2da0eca88e748133b187d6c9d6a9efc431564a0d9e4c5
7
- data.tar.gz: 1de8d318e631a5e31c2babb44a01424a0371332c05678dce832a55ac1e895963a6a571a3e7a78cf5b65d951c3f81f5b1ddd63fbf801edb078d46d13df5de6552
6
+ metadata.gz: 5c13da093e85c3524da32a7415600c8e6f46376fa3b9c1f86fc64115ec9b44f375a304e799edf2bb0fcd19647fa9fadbb5bc669332cfc65d8094a2ed51cf8da2
7
+ data.tar.gz: f12094b18f644e91eca7fe9ac0cdd8d987ce41d910830d89bb149f9843368c76511f53a7e8aba0110d15918a0d7410053bf552bb0480101ab1227097bbe86011
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Legion
4
+ module Extensions
5
+ module Mesh
6
+ module Transport
7
+ module Exchanges
8
+ class Fanout < Legion::Transport::Exchange
9
+ def exchange_name
10
+ 'amq.fanout'
11
+ end
12
+
13
+ def default_type
14
+ 'fanout'
15
+ end
16
+
17
+ def default_options
18
+ hash = super
19
+ hash[:passive] = true
20
+ hash
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -7,7 +7,7 @@ module Legion
7
7
  module Messages
8
8
  class Gossip < Legion::Transport::Message
9
9
  def exchange
10
- Legion::Transport::Exchanges::Node
10
+ Legion::Extensions::Mesh::Transport::Exchanges::Fanout
11
11
  end
12
12
 
13
13
  def routing_key
@@ -7,7 +7,7 @@ module Legion
7
7
  module Messages
8
8
  class MeshConflict < Legion::Transport::Message
9
9
  def exchange
10
- Legion::Transport::Exchanges::Node
10
+ Legion::Extensions::Mesh::Transport::Exchanges::Fanout
11
11
  end
12
12
 
13
13
  def routing_key
@@ -7,7 +7,7 @@ module Legion
7
7
  module Messages
8
8
  class MeshDeparture < Legion::Transport::Message
9
9
  def exchange
10
- Legion::Transport::Exchanges::Node
10
+ Legion::Extensions::Mesh::Transport::Exchanges::Fanout
11
11
  end
12
12
 
13
13
  def routing_key
@@ -11,11 +11,7 @@ module Legion
11
11
  end
12
12
 
13
13
  def exchange
14
- Legion::Transport::Exchanges::Node
15
- end
16
-
17
- def routing_key
18
- 'mesh.gossip'
14
+ Legion::Extensions::Mesh::Transport::Exchanges::Fanout
19
15
  end
20
16
  end
21
17
  end
@@ -3,7 +3,7 @@
3
3
  module Legion
4
4
  module Extensions
5
5
  module Mesh
6
- VERSION = '0.4.5'
6
+ VERSION = '0.4.6'
7
7
  end
8
8
  end
9
9
  end
@@ -14,6 +14,7 @@ require 'legion/extensions/mesh/runners/delegation'
14
14
  require 'legion/extensions/mesh/runners/task_request'
15
15
 
16
16
  if Legion.const_defined?(:Transport, false)
17
+ require 'legion/extensions/mesh/transport/exchanges/fanout'
17
18
  require 'legion/extensions/mesh/transport/messages/preference_query'
18
19
  require 'legion/extensions/mesh/transport/messages/preference_response'
19
20
  require 'legion/extensions/mesh/transport/messages/mesh_departure'
@@ -14,17 +14,15 @@ unless defined?(Legion::Transport::Message)
14
14
  end
15
15
  end
16
16
 
17
- unless defined?(Legion::Transport::Exchanges::Node)
17
+ unless defined?(Legion::Transport::Exchange)
18
18
  module Legion
19
19
  module Transport
20
- module Exchanges
21
- class Node # rubocop:disable Lint/EmptyClass
22
- end
23
- end
20
+ class Exchange; end # rubocop:disable Lint/EmptyClass
24
21
  end
25
22
  end
26
23
  end
27
24
 
25
+ require 'legion/extensions/mesh/transport/exchanges/fanout'
28
26
  require 'legion/extensions/mesh/transport/messages/gossip'
29
27
 
30
28
  RSpec.describe Legion::Extensions::Mesh::Transport::Messages::Gossip do
@@ -36,8 +34,8 @@ RSpec.describe Legion::Extensions::Mesh::Transport::Messages::Gossip do
36
34
  )
37
35
  end
38
36
 
39
- it 'uses the node exchange' do
40
- expect(subject.exchange).to eq(Legion::Transport::Exchanges::Node)
37
+ it 'uses the fanout exchange' do
38
+ expect(subject.exchange).to eq(Legion::Extensions::Mesh::Transport::Exchanges::Fanout)
41
39
  end
42
40
 
43
41
  it 'routes to mesh.gossip' do
@@ -14,17 +14,15 @@ unless defined?(Legion::Transport::Message)
14
14
  end
15
15
  end
16
16
 
17
- unless defined?(Legion::Transport::Exchanges::Node)
17
+ unless defined?(Legion::Transport::Exchange)
18
18
  module Legion
19
19
  module Transport
20
- module Exchanges
21
- class Node # rubocop:disable Lint/EmptyClass
22
- end
23
- end
20
+ class Exchange; end # rubocop:disable Lint/EmptyClass
24
21
  end
25
22
  end
26
23
  end
27
24
 
25
+ require 'legion/extensions/mesh/transport/exchanges/fanout'
28
26
  require 'legion/extensions/mesh/transport/messages/mesh_conflict'
29
27
 
30
28
  RSpec.describe Legion::Extensions::Mesh::Transport::Messages::MeshConflict do
@@ -37,8 +35,8 @@ RSpec.describe Legion::Extensions::Mesh::Transport::Messages::MeshConflict do
37
35
  end
38
36
 
39
37
  describe '#exchange' do
40
- it 'returns the Node exchange' do
41
- expect(msg.exchange).to eq(Legion::Transport::Exchanges::Node)
38
+ it 'returns the Fanout exchange' do
39
+ expect(msg.exchange).to eq(Legion::Extensions::Mesh::Transport::Exchanges::Fanout)
42
40
  end
43
41
  end
44
42
 
@@ -14,17 +14,15 @@ unless defined?(Legion::Transport::Message)
14
14
  end
15
15
  end
16
16
 
17
- unless defined?(Legion::Transport::Exchanges::Node)
17
+ unless defined?(Legion::Transport::Exchange)
18
18
  module Legion
19
19
  module Transport
20
- module Exchanges
21
- class Node # rubocop:disable Lint/EmptyClass
22
- end
23
- end
20
+ class Exchange; end # rubocop:disable Lint/EmptyClass
24
21
  end
25
22
  end
26
23
  end
27
24
 
25
+ require 'legion/extensions/mesh/transport/exchanges/fanout'
28
26
  require 'legion/extensions/mesh/transport/messages/mesh_departure'
29
27
 
30
28
  RSpec.describe Legion::Extensions::Mesh::Transport::Messages::MeshDeparture do
@@ -36,8 +34,8 @@ RSpec.describe Legion::Extensions::Mesh::Transport::Messages::MeshDeparture do
36
34
  end
37
35
 
38
36
  describe '#exchange' do
39
- it 'returns the Node exchange' do
40
- expect(msg.exchange).to eq(Legion::Transport::Exchanges::Node)
37
+ it 'returns the Fanout exchange' do
38
+ expect(msg.exchange).to eq(Legion::Extensions::Mesh::Transport::Exchanges::Fanout)
41
39
  end
42
40
  end
43
41
 
@@ -12,17 +12,25 @@ unless defined?(Legion::Transport::Queue)
12
12
  end
13
13
  end
14
14
 
15
- unless defined?(Legion::Transport::Exchanges::Node)
15
+ unless defined?(Legion::Transport::Queue)
16
16
  module Legion
17
17
  module Transport
18
- module Exchanges
19
- class Node # rubocop:disable Lint/EmptyClass
20
- end
18
+ class Queue
19
+ def initialize(**); end
21
20
  end
22
21
  end
23
22
  end
24
23
  end
25
24
 
25
+ unless defined?(Legion::Transport::Exchange)
26
+ module Legion
27
+ module Transport
28
+ class Exchange; end # rubocop:disable Lint/EmptyClass
29
+ end
30
+ end
31
+ end
32
+
33
+ require 'legion/extensions/mesh/transport/exchanges/fanout'
26
34
  require 'legion/extensions/mesh/transport/queues/gossip'
27
35
 
28
36
  RSpec.describe Legion::Extensions::Mesh::Transport::Queues::Gossip do
@@ -35,14 +43,8 @@ RSpec.describe Legion::Extensions::Mesh::Transport::Queues::Gossip do
35
43
  end
36
44
 
37
45
  describe '#exchange' do
38
- it 'returns Legion::Transport::Exchanges::Node' do
39
- expect(queue.exchange).to eq(Legion::Transport::Exchanges::Node)
40
- end
41
- end
42
-
43
- describe '#routing_key' do
44
- it "returns 'mesh.gossip'" do
45
- expect(queue.routing_key).to eq('mesh.gossip')
46
+ it 'returns the Fanout exchange' do
47
+ expect(queue.exchange).to eq(Legion::Extensions::Mesh::Transport::Exchanges::Fanout)
46
48
  end
47
49
  end
48
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-mesh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity
@@ -164,6 +164,7 @@ files:
164
164
  - lib/legion/extensions/mesh/runners/mesh.rb
165
165
  - lib/legion/extensions/mesh/runners/preferences.rb
166
166
  - lib/legion/extensions/mesh/runners/task_request.rb
167
+ - lib/legion/extensions/mesh/transport/exchanges/fanout.rb
167
168
  - lib/legion/extensions/mesh/transport/messages/gossip.rb
168
169
  - lib/legion/extensions/mesh/transport/messages/mesh_conflict.rb
169
170
  - lib/legion/extensions/mesh/transport/messages/mesh_departure.rb