Download apps/automation/services/sms/task_queue.py from jun2024/fc: direct link, hf CLI and curl.
- Browser
- Download file 653 Bytes
-
https://huggingface.co/spaces/jun2024/fc/resolve/main/apps/automation/services/sms/task_queue.py
- Command line
-
hf download hf://spaces/jun2024/fc/apps/automation/services/sms/task_queue.py
-
curl -L -o task_queue.py https://huggingface.co/spaces/jun2024/fc/resolve/main/apps/automation/services/sms/task_queue.py
653 Bytes
| """Business logic services.""" | |
| from __future__ import annotations | |
| from collections.abc import Callable | |
| from dataclasses import dataclass | |
| from typing import Any, Protocol | |
| class TaskQueue(Protocol): | |
| def enqueue( | |
| self, func_path: str | Callable[..., Any], *args: Any, task_name: str | None = None, **kwargs: Any | |
| ) -> str: ... | |
| class DjangoQTaskQueue: | |
| def enqueue( | |
| self, func_path: str | Callable[..., Any], *args: Any, task_name: str | None = None, **kwargs: Any | |
| ) -> Any: | |
| from django_q.tasks import async_task | |
| return async_task(func_path, *args, task_name=task_name, **kwargs) | |