Class: Rpush::Daemon::ProcTitle

Inherits:
Object
  • Object
show all
Defined in:
lib/rpush/daemon/proc_title.rb

Class Method Summary collapse

Class Method Details

.proc_titleObject



9
10
11
12
13
14
# File 'lib/rpush/daemon/proc_title.rb', line 9

def self.proc_title
  total_dispatchers = AppRunner.total_dispatchers
  dispatchers_str = total_dispatchers == 1 ? 'dispatcher' : 'dispatchers'
  total_queued = AppRunner.total_queued
  format("rpush | %d queued | %d %s", total_queued, total_dispatchers, dispatchers_str)
end

.updateObject



4
5
6
7
# File 'lib/rpush/daemon/proc_title.rb', line 4

def self.update
  return if Rpush.config.embedded || Rpush.config.push
  Process.respond_to?(:setproctitle) ? Process.setproctitle(proc_title) : $0 = proc_title
end