def METHOD_NAME(self, *_args):
    tasks = asyncio.all_tasks()
    logger.warning(
        "Application shutdown detected!\n %s",
        pformat([t.get_name() for t in tasks]),
    )
    self.kill_now = True
    assert self.worker  # nosec
    self.task = asyncio.create_task(
        self.worker.close(timeout=5), name="close_dask_worker_task"
    )