class documentation
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 |
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 |
Main background loop - waits for all clients to exit, then shuts down the current process. |
Method | _background |
Undocumented |
Method | _handle |
Handles an incoming IPC message. |
Method | _notify |
Notifies _background_loop that a client has exited. |
Constant | _PARENT |
Undocumented |
Handles an incoming IPC message.
This currently supports registering and unregistering clients.
Parameters | |
message:tuple | a 2-item tuple (command: str, argument) |
Returns | |
response to send to the client (True on success, Exception on failure) |