    async def terminate_task(self, task, reason=None):
        """Terminate a given task."""
        self.logger.debug(f"Terminating task '{task.name}'")
        await task._terminate_all(reason=reason)
Terminate a given task.
rocketry/core/schedule.py