def _run_supervisor(self):
import time<EOL>still_supervising = lambda: (<EOL>multiprocessing.active_children()<EOL>or not self.log_queue.empty()<EOL>or not self.exception_queue.empty())<EOL>try:<EOL><INDENT>while still_supervising():<EOL><INDENT>try:<EOL><INDENT>record = self.log_queue.get_nowait()<EOL>logger = logging.getLogger(record.name)<EOL>logger.handle(record)<EOL><DEDENT>except queue.Empty:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>exception = self.exception_queue.get_nowait()<EOL><DEDENT>except queue.Empty:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>raise exception<EOL><DEDENT>time.sleep(<NUM_LIT:1>/self.frame_rate)<EOL>self.elapsed_time += <NUM_LIT:1>/self.frame_rate<EOL>if self.time_limit and self.elapsed_time > self.time_limit:<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT><DEDENT><DEDENT>finally:<EOL><INDENT>for process in multiprocessing.active_children():<EOL><INDENT>process.terminate()<EOL><DEDENT><DEDENT>
Poll the queues that the worker can use to communicate with the 
supervisor, until all the workers are done and all the queues are 
empty.  Handle messages as they appear.