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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +53 -80
  3. data/.rspec +1 -0
  4. data/.rubocop.yml +3 -9
  5. data/CHANGELOG.md +9 -0
  6. data/Gemfile +0 -1
  7. data/README.md +3 -0
  8. data/bitbucket-pipelines.yml +1 -1
  9. data/legion-transport.gemspec +19 -14
  10. data/lib/legion/transport.rb +12 -10
  11. data/lib/legion/transport/common.rb +23 -18
  12. data/lib/legion/transport/connection.rb +56 -12
  13. data/lib/legion/transport/consumer.rb +8 -1
  14. data/lib/legion/transport/exchange.rb +44 -6
  15. data/lib/legion/transport/exchanges/crypt.rb +11 -0
  16. data/lib/legion/transport/exchanges/node.rb +11 -0
  17. data/lib/legion/transport/message.rb +100 -2
  18. data/lib/legion/transport/messages/check_subtask.rb +25 -0
  19. data/lib/legion/transport/messages/dynamic.rb +25 -0
  20. data/lib/legion/transport/messages/lex_register.rb +11 -19
  21. data/lib/legion/transport/messages/node_health.rb +21 -0
  22. data/lib/legion/transport/messages/request_cluster_secret.rb +33 -0
  23. data/lib/legion/transport/messages/subtask.rb +38 -0
  24. data/lib/legion/transport/messages/task_log.rb +36 -0
  25. data/lib/legion/transport/messages/task_update.rb +3 -24
  26. data/lib/legion/transport/queue.rb +65 -6
  27. data/lib/legion/transport/queues/node.rb +15 -0
  28. data/lib/legion/transport/queues/node_crypt.rb +21 -0
  29. data/lib/legion/transport/queues/node_status.rb +1 -1
  30. data/lib/legion/transport/queues/task_log.rb +1 -1
  31. data/lib/legion/transport/queues/task_update.rb +1 -1
  32. data/lib/legion/transport/settings.rb +72 -0
  33. data/lib/legion/transport/version.rb +1 -1
  34. data/settings/transport.json +5 -1
  35. data/sonar-project.properties +12 -0
  36. metadata +93 -49
  37. data/lib/legion/transport/connections/bunny.rb +0 -53
  38. data/lib/legion/transport/connections/common.rb +0 -36
  39. data/lib/legion/transport/connections/marchhare.rb +0 -20
  40. data/lib/legion/transport/consumers/bunny.rb +0 -11
  41. data/lib/legion/transport/consumers/common.rb +0 -8
  42. data/lib/legion/transport/consumers/marchhare.rb +0 -11
  43. data/lib/legion/transport/exchanges/bunny.rb +0 -28
  44. data/lib/legion/transport/exchanges/common.rb +0 -32
  45. data/lib/legion/transport/exchanges/marchhare.rb +0 -17
  46. data/lib/legion/transport/messages/base.rb +0 -22
  47. data/lib/legion/transport/messages/node_status.rb +0 -49
  48. data/lib/legion/transport/messages/task_check_subtask.rb +0 -35
  49. data/lib/legion/transport/messages/task_subtask.rb +0 -45
  50. data/lib/legion/transport/queues/bunny.rb +0 -26
  51. data/lib/legion/transport/queues/common.rb +0 -45
  52. 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