Код: Выделить всё
CeleryTask: TypeAlias = "Task[Any, Any]"
Код: Выделить всё
@celery.task(
bind=True,
...
)
def handle_webhook(self: CeleryTask, webhook: Webhook) -> None:
# do stuff
Код: Выделить всё
webhook_map: dict[str, Callable[[Task, 'Webhook'], None]] = {
"order.webhook": handle_webhook
}
Код: Выделить всё
webhook_map: dict[str, (CeleryTask, Webhook)] = {
"order.webhook": handle_webhook
}
Код: Выделить всё
webhook_map: dict[str, CeleryTask] = {
"order.webhook": handle_webhook
}
Как мне правильно сохранить CeleryTasks в моем dict< /code> и задержку звонка, чтобы запланировать их позже? Возможно ли это в Python? Спасибо!
Подробнее здесь: https://stackoverflow.com/questions/792 ... -mypy-type