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.
30 31 32 |
# File 'lib/fastly_nsq/cli.rb', line 30 def end |
Instance Method Details
#parse_options(args = ARGV) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/fastly_nsq/cli.rb', line 32 def (args = ARGV) parse(args) setup_logger check_pid daemonize if daemonize? write_pid end |
#run ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/fastly_nsq/cli.rb', line 40 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 |