Module: Tennpipes::Cli::Adapter
- Defined in:
- lib/tennpipes-base/cli/adapter.rb
Class Method Summary collapse
-
.start(options) ⇒ Object
Start for the given options a rackup handler.
-
.stop(options) ⇒ Object
Method that stop (if exist) a running Tennpipes.application.
Class Method Details
.start(options) ⇒ Object
Start for the given options a rackup handler
6 7 8 |
# File 'lib/tennpipes-base/cli/adapter.rb', line 6 def start() Tennpipes.run!(.symbolize_keys) end |
.stop(options) ⇒ Object
Method that stop (if exist) a running Tennpipes.application
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/tennpipes-base/cli/adapter.rb', line 11 def stop() .symbolize_keys! if File.exist?([:pid]) pid = File.read([:pid]).to_i puts "=> Sending INT to process with pid #{pid}" begin Process.kill(2, pid) rescue Errno::ESRCH, RangeError => error puts error. exit rescue Errno::EPERM => error puts error. abort end else puts "=> #{options[:pid]} not found!" abort end end |