async def monitor_tasks(self, interval: float=<NUM_LIT:1.0>) -> None:
Log.debug('<STR_LIT>')<EOL>while True:<EOL><INDENT>try:<EOL><INDENT>await asyncio.sleep(interval)<EOL>for name, task in self.all_tasks.items():<EOL><INDENT>if self.terminate_on_finish:<EOL><INDENT>if task in self.running_tasks and task.running:<EOL><INDENT>await task.stop()<EOL><DEDENT><DEDENT>elif task.enabled:<EOL><INDENT>if task not in self.running_tasks:<EOL><INDENT>Log.debug('<STR_LIT>', task.name)<EOL>await self.insert(task)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if task in self.running_tasks:<EOL><INDENT>Log.debug('<STR_LIT>', task.name)<EOL>await task.stop()<EOL><DEDENT><DEDENT><DEDENT>if self.terminate_on_finish and not self.running_tasks:<EOL><INDENT>Log.debug('<STR_LIT>')<EOL>break<EOL><DEDENT><DEDENT>except CancelledError:<EOL><INDENT>Log.debug('<STR_LIT>')<EOL>break<EOL><DEDENT>except Exception:<EOL><INDENT>Log.exception('<STR_LIT>')<EOL><DEDENT><DEDENT>self.monitor = None<EOL>self.loop.call_later(<NUM_LIT:0>, self.terminate)<EOL>
Monitor all known tasks for run state.  Ensure that enabled tasks
        are running, and that disabled tasks are stopped.