Class: Sbmt::Outbox::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/sbmt/outbox/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/sbmt/outbox/cli.rb', line 9

def self.exit_on_failure?
  true
end

Instance Method Details

#startObject



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/sbmt/outbox/cli.rb', line 36

def start
  load_environment

  boxes = format_boxes(options[:box])
  check_deprecations!(boxes)

  worker = Sbmt::Outbox::V2::Worker.new(
    boxes: boxes,
    poll_tactic: options[:poll_tactic],
    poller_threads_count: options[:poll_threads],
    poller_partitions_count: options[:poll_concurrency],
    processor_concurrency: options[:concurrency] || 4
  )

  Sbmt::Outbox.current_worker = worker

  watch_signals(worker)

  $stdout.puts AsciiArt.
  $stdout.puts "Outbox/Inbox worker has been started"
  $stdout.puts "Version: #{VERSION}"
  Sbmt::Outbox::Probes::Probe.run_probes
  Sbmt::Outbox::Probes::Metrics.run_metrics

  worker.start
end