class documentation

class ProcessMonitor(Thread):

Constructor: ProcessMonitor(name)

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method add_process_listener Listener for process events. MUST be called before ProcessMonitor is running.See ProcessListener class. @param l: listener instance @type l: L{ProcessListener}
Method do_main_thread_jobs Execute tasks that need to be run in the main thread. Must be called from main thread.
Method get_active_names @return [str]: list of active process names
Method get_process @return: process registered under \x07 name, or None @rtype: L{Process}
Method get_process_names_with_spawn_count @return: Two lists, where first list of active process names along with the number of times that process has been spawned. Second list contains dead process names and their spawn count. @rtype: [[(str, int),], [(str,int),]]...
Method has_main_thread_jobs @return: True if ProcessMonitor has tasks that need to be run in the main thread @rtype: bool
Method has_process @return: True if process is still be monitored. If False, process has died or was never registered with process @rtype: bool
Method kill_process Kill process that matches name. NOTE: a killed process will continue to show up as active until the process monitor thread has caught that it has died. @param name: Process name @type name: str @return: True if a process named name was removed from process monitor...
Method mainthread_spin run() occurs in a separate thread and cannot do certain signal-related work. The main thread of the application must call mainthread_spin() or mainthread_spin_once() in order to perform these jobs. mainthread_spin() blocks until the process monitor is complete.
Method mainthread_spin_once run() occurs in a separate thread and cannot do certain signal-related work. The main thread of the application must call mainthread_spin() or mainthread_spin_once() in order to perform these jobs.
Method register Register process with L{ProcessMonitor} @param p: Process @type p: L{Process} @raise RLException: if process with same name is already registered
Method register_core_proc Register core process with ProcessMonitor. Coreprocesses have special shutdown semantics. They are killed after all other processes, in reverse order in which they are added. @param p Process @type p: L{Process} @raise RLException: if process with same name is already registered...
Method registrations_complete Inform the process monitor that registrations are complete. After the registrations_complete flag is set, process monitor will exit if there are no processes left to monitor.
Method run thread routine of the process monitor. NOTE: you must still call mainthread_spin or mainthread_spin_once() from the main thread in order to pick up main thread work from the process monitor.
Method shutdown Shutdown the process monitor thread
Method unregister Undocumented
Instance Variable core_procs Undocumented
Instance Variable daemon Undocumented
Instance Variable dead_list Undocumented
Instance Variable done Undocumented
Instance Variable is_shutdown Undocumented
Instance Variable listeners Undocumented
Instance Variable plock Undocumented
Instance Variable procs Undocumented
Instance Variable reacquire_signals Undocumented
Method _post_run Undocumented
Method _run Internal run loop of ProcessMonitor
Instance Variable _registrations_complete Undocumented
def __init__(self, name='ProcessMonitor'):

Undocumented

def add_process_listener(self, l):

Listener for process events. MUST be called before ProcessMonitor is running.See ProcessListener class. @param l: listener instance @type l: L{ProcessListener}

def do_main_thread_jobs(self):

Execute tasks that need to be run in the main thread. Must be called from main thread.

def get_active_names(self):

@return [str]: list of active process names

def get_process(self, name):

@return: process registered under \x07 name, or None @rtype: L{Process}

def get_process_names_with_spawn_count(self):

@return: Two lists, where first list of active process names along with the number of times that process has been spawned. Second list contains dead process names and their spawn count. @rtype: [[(str, int),], [(str,int),]]

def has_main_thread_jobs(self):

@return: True if ProcessMonitor has tasks that need to be run in the main thread @rtype: bool

def has_process(self, name):

@return: True if process is still be monitored. If False, process has died or was never registered with process @rtype: bool

def kill_process(self, name):

Kill process that matches name. NOTE: a killed process will continue to show up as active until the process monitor thread has caught that it has died. @param name: Process name @type name: str @return: True if a process named name was removed from process monitor. A process is considered killed if its stop() method was called. @rtype: bool

def mainthread_spin(self):

run() occurs in a separate thread and cannot do certain signal-related work. The main thread of the application must call mainthread_spin() or mainthread_spin_once() in order to perform these jobs. mainthread_spin() blocks until the process monitor is complete.

def mainthread_spin_once(self):

run() occurs in a separate thread and cannot do certain signal-related work. The main thread of the application must call mainthread_spin() or mainthread_spin_once() in order to perform these jobs.

def register(self, p):

Register process with L{ProcessMonitor} @param p: Process @type p: L{Process} @raise RLException: if process with same name is already registered

def register_core_proc(self, p):

Register core process with ProcessMonitor. Coreprocesses have special shutdown semantics. They are killed after all other processes, in reverse order in which they are added. @param p Process @type p: L{Process} @raise RLException: if process with same name is already registered

def registrations_complete(self):

Inform the process monitor that registrations are complete. After the registrations_complete flag is set, process monitor will exit if there are no processes left to monitor.

def run(self):

thread routine of the process monitor. NOTE: you must still call mainthread_spin or mainthread_spin_once() from the main thread in order to pick up main thread work from the process monitor.

def shutdown(self):

Shutdown the process monitor thread

def unregister(self, p):

Undocumented

core_procs: list =

Undocumented

daemon: bool =

Undocumented

dead_list: list =

Undocumented

done: bool =

Undocumented

is_shutdown: bool =

Undocumented

listeners: list =

Undocumented

plock =

Undocumented

procs: list =

Undocumented

reacquire_signals: set =

Undocumented

def _post_run(self):

Undocumented

def _run(self):

Internal run loop of ProcessMonitor

_registrations_complete: bool =

Undocumented