Class: FastlyNsq::CLI
- Inherits:
-
Object
- Object
- FastlyNsq::CLI
- Includes:
- Singleton
- Defined in:
- lib/fastly_nsq/cli.rb
Overview
Provides functionality to support running FastlyNsq as a command line application that listens and processes NSQ messages.
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
29 30 31 |
# File 'lib/fastly_nsq/cli.rb', line 29 def @options end |
Instance Method Details
#parse_options(args = ARGV) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/fastly_nsq/cli.rb', line 31 def (args = ARGV) parse(args) setup_logger check_pid daemonize if daemonize? write_pid end |
#run ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/fastly_nsq/cli.rb', line 39 def run startup launcher.beat read_loop rescue Interrupt FastlyNsq.logger.info "Shutting down" launcher.stop # Explicitly exit so busy Processor threads can't block # process shutdown. FastlyNsq.logger.info "Bye!" exit(0) end |