legion-transport 0.1.0 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +53 -80
- data/.rspec +1 -0
- data/.rubocop.yml +3 -9
- data/CHANGELOG.md +9 -0
- data/Gemfile +0 -1
- data/README.md +3 -0
- data/bitbucket-pipelines.yml +1 -1
- data/legion-transport.gemspec +19 -14
- data/lib/legion/transport.rb +12 -10
- data/lib/legion/transport/common.rb +23 -18
- data/lib/legion/transport/connection.rb +56 -12
- data/lib/legion/transport/consumer.rb +8 -1
- data/lib/legion/transport/exchange.rb +44 -6
- data/lib/legion/transport/exchanges/crypt.rb +11 -0
- data/lib/legion/transport/exchanges/node.rb +11 -0
- data/lib/legion/transport/message.rb +100 -2
- data/lib/legion/transport/messages/check_subtask.rb +25 -0
- data/lib/legion/transport/messages/dynamic.rb +25 -0
- data/lib/legion/transport/messages/lex_register.rb +11 -19
- data/lib/legion/transport/messages/node_health.rb +21 -0
- data/lib/legion/transport/messages/request_cluster_secret.rb +33 -0
- data/lib/legion/transport/messages/subtask.rb +38 -0
- data/lib/legion/transport/messages/task_log.rb +36 -0
- data/lib/legion/transport/messages/task_update.rb +3 -24
- data/lib/legion/transport/queue.rb +65 -6
- data/lib/legion/transport/queues/node.rb +15 -0
- data/lib/legion/transport/queues/node_crypt.rb +21 -0
- data/lib/legion/transport/queues/node_status.rb +1 -1
- data/lib/legion/transport/queues/task_log.rb +1 -1
- data/lib/legion/transport/queues/task_update.rb +1 -1
- data/lib/legion/transport/settings.rb +72 -0
- data/lib/legion/transport/version.rb +1 -1
- data/settings/transport.json +5 -1
- data/sonar-project.properties +12 -0
- metadata +93 -49
- data/lib/legion/transport/connections/bunny.rb +0 -53
- data/lib/legion/transport/connections/common.rb +0 -36
- data/lib/legion/transport/connections/marchhare.rb +0 -20
- data/lib/legion/transport/consumers/bunny.rb +0 -11
- data/lib/legion/transport/consumers/common.rb +0 -8
- data/lib/legion/transport/consumers/marchhare.rb +0 -11
- data/lib/legion/transport/exchanges/bunny.rb +0 -28
- data/lib/legion/transport/exchanges/common.rb +0 -32
- data/lib/legion/transport/exchanges/marchhare.rb +0 -17
- data/lib/legion/transport/messages/base.rb +0 -22
- data/lib/legion/transport/messages/node_status.rb +0 -49
- data/lib/legion/transport/messages/task_check_subtask.rb +0 -35
- data/lib/legion/transport/messages/task_subtask.rb +0 -45
- data/lib/legion/transport/queues/bunny.rb +0 -26
- data/lib/legion/transport/queues/common.rb +0 -45
- data/lib/legion/transport/queues/marchhare.rb +0 -26
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'legion/transport/queues/common'
|
2
|
-
|
3
|
-
module Legion
|
4
|
-
module Transport
|
5
|
-
module Queues
|
6
|
-
class Marchhare < ::MarchHare::Queue
|
7
|
-
include Legion::Transport::Queues::Common
|
8
|
-
def initialize(queue = queue_name, options = {})
|
9
|
-
retries ||= 0
|
10
|
-
@options = options
|
11
|
-
super(channel, queue, options_builder(options))
|
12
|
-
rescue ::Marchhare::PreconditionFailed
|
13
|
-
retries.zero? ? retries = 1 : raise
|
14
|
-
recreate_queue(channel, queue)
|
15
|
-
retry
|
16
|
-
end
|
17
|
-
|
18
|
-
def recreate_queue(channel, queue)
|
19
|
-
Legion::Logging.warn "Queue:#{queue} exists with wrong parameters, deleting and creating"
|
20
|
-
queue = ::Marchhare::Queue.new(channel, queue, no_declare: true, passive: true)
|
21
|
-
queue.delete(if_empty: true)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|