Skip to content

Feat/jobs taskiq - #74

Merged
Iamsdt merged 2 commits into
mainfrom
feat/jobs-taskiq
Nov 7, 2026
Merged

Iamsdt merged 2 commits into
mainfrom
feat/jobs-taskiq

Conversation

@Iamsdt

@Iamsdt Iamsdt commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Background tasks on TaskIQ

Adds durable background tasks to 10xgraph-api as a thin layer over TaskIQ: we own one broker, wire monitoring, auth and the run config, and add worker / scheduler commands and HTTP routes. TaskIQ does the queueing, retries, results and scheduling.

Developer API

from typing import Annotated
from taskiq import TaskiqDepends
from tenxgraph_api.jobs import broker, TaskContext

@broker.task(task_name="make_report", http=True)
async def make_report(topic: str, config: dict, ctx: Annotated[TaskContext, TaskiqDepends()]) -> dict:
    if await ctx.cancelled():
        return {"cancelled": True}
    return {"topic": topic, "user_id": config["user_id"]}

@codecov

codecov Bot commented Nov 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Iamsdt
Iamsdt merged commit d8262b9 into main Nov 7, 2026
9 checks passed
@Iamsdt
Iamsdt deleted the feat/jobs-taskiq branch November 7, 2026 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant