Class: Epi::Daemon::Responders::StopAll

Inherits:
Epi::Daemon::Responder show all
Defined in:
lib/epi/daemon/responders/stop_all.rb

Instance Attribute Summary

Attributes inherited from Epi::Daemon::Responder

#receiver

Instance Method Summary collapse

Methods inherited from Epi::Daemon::Responder

#done, #initialize, #logger, #puts, #run, run

Constructor Details

This class inherits a constructor from Epi::Daemon::Responder

Instance Method Details

#run_asyncObject



7
8
9
10
11
12
13
14
15
# File 'lib/epi/daemon/responders/stop_all.rb', line 7

def run_async
  count = Jobs.running_process_count
  if count > 0
    puts "Stopping #{count} process#{count == 1 ? '' : 'es'} ..."
    Jobs.shutdown! { done }
  else
    done
  end
end