class Sidekiq::CLI

def launch(self_read)

def launch(self_read)
  if environment == "development" && $stdout.tty?
    logger.info "Starting processing, hit Ctrl-C to stop"
  end
  @launcher = Sidekiq::Launcher.new(options)
  begin
    launcher.run
    while (readable_io = IO.select([self_read]))
      signal = readable_io.first[0].gets.strip
      handle_signal(signal)
    end
  rescue Interrupt
    logger.info "Shutting down"
    launcher.stop
    logger.info "Bye!"
    # Explicitly exit so busy Processor threads won't block process shutdown.
    #
    # NB: slow at_exit handlers will prevent a timely exit if they take
    # a while to run. If Sidekiq is getting here but the process isn't exiting,
    # use the TTIN signal to determine where things are stuck.
    exit(0)
  end
end