Package cherrypy :: Package process :: Module plugins :: Class SignalHandler
[hide private]
[frames] | no frames]

Class SignalHandler

source code

object --+
         |
        SignalHandler

Register bus channels (and listeners) for system signals.

By default, instantiating this object subscribes the following signals
and listeners:

    TERM: bus.exit
    HUP : bus.restart
    USR1: bus.graceful

Instance Methods [hide private]
 
__init__(self, bus)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
subscribe(self) source code
 
unsubscribe(self) source code
 
set_handler(self, signal, listener=None)
Subscribe a handler for the given signal (number or name).
source code
 
_handle_signal(self, signum=None, frame=None)
Python signal handler (self.set_handler subscribes it for you).
source code
 
handle_SIGHUP(self) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  signals = {1: 'SIGHUP', 2: 'SIGINT', 3: 'SIGQUIT', 4: 'SIGILL'...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, bus)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

set_handler(self, signal, listener=None)

source code 

Subscribe a handler for the given signal (number or name).

If the optional 'listener' argument is provided, it will be subscribed as a listener for the given signal's channel.

If the given signal name or number is not available on the current platform, ValueError is raised.


Class Variable Details [hide private]

signals

Value:
{1: 'SIGHUP',
 2: 'SIGINT',
 3: 'SIGQUIT',
 4: 'SIGILL',
 5: 'SIGTRAP',
 6: 'SIGABRT',
 7: 'SIGBUS',
 8: 'SIGFPE',
...