class documentation

class ClientMonitor(object): (source)

Constructor: ClientMonitor()

View In Hierarchy

Monitor to keep track of all clients using this service.

This is only used for services that use multiple clients, e.g. the database service. In addition to tracking the original parent process, other processes can also request to be tracked by sending a message to this process as a tuple: ("register", PID). trigger_exit(PARENT) is only called after the original parent and all registered clients have shut down.

Method __init__ Creates and starts a client monitor.
Method notify_parent_exit Notifies the monitor that the original parent process has exited.
Instance Variable clients Undocumented
Instance Variable cond Undocumented
Instance Variable server Undocumented
Instance Variable thread Undocumented
Method _background_loop Main background loop - waits for all clients to exit, then shuts down the current process.
Method _background_wait Undocumented
Method _handle_message Handles an incoming IPC message.
Method _notify_exit Notifies _background_loop that a client has exited.
Constant _PARENT Undocumented
def __init__(self): (source)

Creates and starts a client monitor.

def notify_parent_exit(self): (source)

Notifies the monitor that the original parent process has exited.

Undocumented

Undocumented

Undocumented

Undocumented

def _background_loop(self): (source)

Main background loop - waits for all clients to exit, then shuts down the current process.

def _background_wait(self, process): (source)

Undocumented

def _handle_message(self, message): (source)

Handles an incoming IPC message.

This currently supports registering and unregistering clients.

Parameters
message:tuplea 2-item tuple (command: str, argument)
Returns
response to send to the client (True on success, Exception on failure)
def _notify_exit(self, process): (source)

Notifies _background_loop that a client has exited.

Undocumented

Value
'parent'