class documentation

class ChildStreamMonitor(object): (source)

Constructor: ChildStreamMonitor(stream)

View In Hierarchy

Monitor for an output stream (stdout or stderr) of a child process.

This class serves multiple purposes: - Collects output from the child process in a rolling buffer in the

background, and makes it available in a thread-safe manner.
  • Causes the current process to exit when the child process closes the stream (i.e. when the child process exits).
Method __init__ Undocumented
Method to_bytes Return output recently collected from the child process.
Instance Variable output_deque Undocumented
Instance Variable stream Undocumented
Method _run_monitor_thread Background task to collect output from the child process.
def __init__(self, stream): (source)

Undocumented

def to_bytes(self): (source)

Return output recently collected from the child process.

Currently, this is limited to the most recent 4KB.

output_deque = (source)

Undocumented

Undocumented

def _run_monitor_thread(self): (source)

Background task to collect output from the child process.

This is primarily necessary to keep the child process from hanging, which would occur if it produces too much output that the current process doesn't read, but the collected output is also made available for convenience.