task_monitor ¶
Task monitoring and cleanup utilities for the Tux bot.
Encapsulates background task monitoring and shutdown cleanup routines.
Classes:
-
TaskMonitor–Manage monitoring and cleanup of asyncio tasks for a bot instance.
Classes¶
TaskMonitor ¶
Python
TaskMonitor(bot: Any)
Manage monitoring and cleanup of asyncio tasks for a bot instance.
Initialize the task monitor.
Parameters:
-
bot(Any) –The bot instance to monitor tasks for.
Methods:
-
start–Start the background task monitoring loop.
-
stop–Stop the background task monitoring loop if running.
-
cleanup_tasks–Clean up all running tasks across the bot and cogs.
Functions¶
_monitor_tasks_loop_impl async ¶
Python
_monitor_tasks_loop_impl() -> None
Monitor and clean up running tasks periodically.
Raises:
-
RuntimeError–If task monitoring encounters a critical failure.
_categorize_tasks ¶
_process_finished_tasks async ¶
Process and clean up finished tasks.
cleanup_tasks async ¶
Python
cleanup_tasks() -> None
Clean up all running tasks across the bot and cogs.
_stop_task_loops async ¶
Python
_stop_task_loops() -> None
Stop all task loops in cogs as well as the monitor loop itself.