loop_safe_stopο
- bapsf_motion.utils.loop_safe_stop(loop: AbstractEventLoop, max_wait: float | None = 6.0)ο
Safely cancel all tasks in the event loop
loopand stop the loop once the tasks are done.- Parameters:
loop (
asyncio.AbstractEventLoop) β Theasyncioevent loop to be stopped.max_wait (
float, optional) β Max wait time in seconds for tasks to finish before stopping the event loop.