Class: Phobos::CLI::Runner
- Inherits:
-
Object
- Object
- Phobos::CLI::Runner
- Defined in:
- lib/phobos/cli/runner.rb
Constant Summary collapse
- SIGNALS =
[:INT, :TERM, :QUIT].freeze
Instance Method Summary collapse
-
#initialize ⇒ Runner
constructor
A new instance of Runner.
- #run! ⇒ Object
Constructor Details
Instance Method Details
#run! ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/phobos/cli/runner.rb', line 14 def run! setup_signals executor.start loop do case signal_queue.pop when *SIGNALS executor.stop break else ready = IO.select([reader, writer]) # drain the self-pipe so it won't be returned again next time reader.read_nonblock(1) if ready[0].include?(reader) end end end |