Aarq¶
aioq.Aarq is the central application object. It holds the broker, task registry, and cron list.
Constructor¶
| Parameter | Type | Description |
|---|---|---|
broker |
BaseBroker |
Broker instance to use for all operations |
@app.task(...)¶
Register an async function as a task.
@app.task(
queue: str = "default",
retries: int = 0,
retry_delay: float = 5.0,
save_result: bool = False,
result_ttl: int = 3600,
)
async def my_task(ctx, ...): ...
Returns a TaskDef instance.
@app.cron(...)¶
Register an async function as a recurring cron task.
@app.cron(
expression: str, # Standard cron expression
queue: str = "default",
name: str | None = None,
)
async def my_cron(ctx): ...
Requires pip install "aioq[cron]".
app.get_task(name)¶
Look up a registered task by its dotted name.
Returns TaskDef | None.
app.task_names¶
Property returning a list of all registered task names.
app.broker¶
Direct access to the broker instance.