Перенес workflow
This commit is contained in:
Binary file not shown.
@@ -13,4 +13,4 @@ class ApplicationModule(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def register(self, registry: ModuleRegistry) -> None:
|
||||
"""Register workers, queues, handlers, services, and health contributors."""
|
||||
"""Register workers, services, and health contributors."""
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Any
|
||||
|
||||
from app_runtime.contracts.tasks import Task
|
||||
|
||||
|
||||
class TaskQueue(ABC):
|
||||
@abstractmethod
|
||||
def publish(self, task: Task) -> None:
|
||||
"""Push a task into the queue."""
|
||||
|
||||
@abstractmethod
|
||||
def consume(self, timeout: float = 0.1) -> Task | None:
|
||||
"""Return the next available task or None."""
|
||||
|
||||
@abstractmethod
|
||||
def ack(self, task: Task) -> None:
|
||||
"""Confirm successful task processing."""
|
||||
|
||||
@abstractmethod
|
||||
def nack(self, task: Task, retry_delay: float | None = None) -> None:
|
||||
"""Signal failed task processing."""
|
||||
|
||||
@abstractmethod
|
||||
def stats(self) -> dict[str, Any]:
|
||||
"""Return transport-level queue statistics."""
|
||||
@@ -1,18 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from abc import ABC, abstractmethod
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class Task:
|
||||
name: str
|
||||
payload: dict[str, Any]
|
||||
metadata: dict[str, Any] = field(default_factory=dict)
|
||||
|
||||
|
||||
class TaskHandler(ABC):
|
||||
@abstractmethod
|
||||
def handle(self, task: Task) -> None:
|
||||
"""Execute domain logic for a task."""
|
||||
Reference in New Issue
Block a user