Class: Sidekiq::CLI
Instance Attribute Summary collapse
-
#code ⇒ Object
Used for CLI testing.
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #parse(args = ARGV) ⇒ Object
- #run ⇒ Object
Methods included from Util
#constantize, logger, #logger, logger=, process_id, #process_id, #redis, #watchdog
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
25 26 27 |
# File 'lib/sidekiq/cli.rb', line 25 def initialize @code = nil end |
Instance Attribute Details
#code ⇒ Object
Used for CLI testing
23 24 25 |
# File 'lib/sidekiq/cli.rb', line 23 def code @code end |
Instance Method Details
#parse(args = ARGV) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/sidekiq/cli.rb', line 29 def parse(args=ARGV) Sidekiq::Util.logger cli = (args) config = parse_config(cli) .merge!(config.merge(cli)) set_logger_level_to_debug if [:verbose] write_pid validate! boot_system end |
#run ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/sidekiq/cli.rb', line 43 def run manager = Sidekiq::Manager.new() begin logger.info 'Starting processing, hit Ctrl-C to stop' manager.start! # HACK need to determine how to pause main thread while # waiting for signals. sleep rescue Interrupt # TODO Need clean shutdown support from Celluloid logger.info 'Shutting down' manager.stop! manager.wait(:shutdown) end end |