class_docstr: 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).
class_docstr_tok: ["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",")","."]
docstr: 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.
docstr_tok: ["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","does","n't","read",",","but","the","collected","output","is","also","made","available","for","convenience","."]
code: def _run_monitor_thread(self):
      """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.
      """
      while True:
          chunk = self.stream.read(1024)
          if not chunk:
              # EOF - subprocess has exited, so trigger shutdown
              trigger_exit(ExitMode.CHILD)
              break
          self.output_deque.appendleft(chunk)
  
imports: import argparse
  import collections
  import enum
  import os
  import signal
  import subprocess
  import sys
  import threading
  import traceback
  import psutil
  from fiftyone.service.ipc import IPCServer
label_desc: Use image node_id 2 for calling the ChildStreamMonitor obj's underlying member method code with example usage: obj._run_monitor_thread() without return types