Package ganeti :: Module daemon :: Class Mainloop
[hide private]
[frames] | no frames]

Class Mainloop

source code


Generic mainloop for daemons

Instance Methods [hide private]
 
__init__(self)
Constructs a new Mainloop instance.
source code
 
Run(self, signal_handlers=None)
Runs the mainloop.
source code
 
_CallSignalWaiters(self, signum)
Calls all signal waiters for a certain signal.
source code
 
RegisterSignal(self, owner)
Registers a receiver for signal notifications
source code

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

Instance Variables [hide private]
  scheduler
A sched.scheduler object, which can be used to register timed events
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Constructs a new Mainloop instance.

Overrides: object.__init__

Run(self, signal_handlers=None)

source code 

Runs the mainloop.

Parameters:
Decorators:
  • @utils.SignalHandled([signal.SIGCHLD])
  • @utils.SignalHandled([signal.SIGTERM])
  • @utils.SignalHandled([signal.SIGINT])

_CallSignalWaiters(self, signum)

source code 

Calls all signal waiters for a certain signal.

Parameters:
  • signum (int) - Signal number

RegisterSignal(self, owner)

source code 

Registers a receiver for signal notifications

The receiver must support a "OnSignal(self, signum)" function.

Parameters:
  • owner (instance) - Receiver