Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
22 lines
359 B
Python
22 lines
359 B
Python
from dataclasses import dataclass, field
|
|
from typing import Optional
|
|
|
|
QUEUED = "queued"
|
|
LEASED = "leased"
|
|
RETRY_WAIT = "retry_wait"
|
|
DONE = "done"
|
|
DEAD = "dead"
|
|
|
|
|
|
@dataclass
|
|
class Job:
|
|
id: str
|
|
kind: str
|
|
payload: dict
|
|
key: str
|
|
client: str
|
|
created_at: float
|
|
status: str = QUEUED
|
|
attempts: int = 0
|
|
worker: Optional[str] = None
|