Logo Async Jobs

Async Jobs

Cộng đồng
yonatangross
async-jobs

Async job processing patterns for background tasks, Celery workflows, task scheduling, retry strategies, and distributed task execution. Use when implementing background job processing, task queues, or scheduled task systems.

Add to TypingMind

Tổng quan

Nhà phát hànhyonatangross
Kho mãorchestkit
Tên kỹ năngasync-jobs
Sao
298
Bản fork
35
Tệp đi kèm
15
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 15 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được yonatangross công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Async Jobs trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/yonatangross/orchestkit/tree/main/plugins/ork/skills/async-jobs
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/yonatangross/orchestkit.git /tmp/orchestkit
mkdir -p .claude/skills
cp -r /tmp/orchestkit/plugins/ork/skills/async-jobs .claude/skills/async-jobs
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Async Jobs trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Async Jobs ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Async Jobs với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Async Jobs

Background task processing with Celery, ARQ, Redis and Temporal. This skill is a wrapper, not a manual: Celery and ARQ document their own product well, so what lives here is our delta, the thresholds, working config, ordering constraints and tool-choice rules we picked. Product mechanics are linked, not restated.

Start with Read("references/ork-delta.md").

Quick Reference

TopicWhere our part lives
Configurationreferences/celery-config.md, rules/jobs-task-queue.md
Task Routingreferences/ork-delta.md (queue taxonomy, prefetch tiers, Redis priority)
Canvas Workflowsrules/celery-canvas.md
Retry Strategiesreferences/ork-delta.md (backoff cap, idempotency layers, lock TTLs)
Schedulingrules/jobs-scheduling.md, references/ork-delta.md (beat process model)
Monitoringreferences/ork-delta.md (alert thresholds, histogram buckets)
Result Backendsrules/jobs-monitoring.md, references/ork-delta.md (return contract)
ARQ Patternsrules/jobs-task-queue.md, references/ork-delta.md (budgets, pool ownership)
Temporal Workflowsrules/temporal-workflows.md
Temporal Activitiesrules/temporal-activities.md

10 topic areas, 6 rule files in rules/, house delta in references/ork-delta.md.

Quick Start

python
@app.task(bind=True, max_retries=3, default_retry_delay=60)
def process_payment(self, order_id: str):
    try:
        return gateway.charge(order_id)
    except TransientError as exc:
        raise self.retry(exc=exc, countdown=2 ** self.request.retries * 60)

Load more examples: Read("references/quick-start-examples.md") for Celery retry task and ARQ/FastAPI integration patterns.

Upstream coverage (do not restate)

Fetch these when you need product mechanics. The right-hand column is the part we keep, because it is a house threshold, a working config or an ordering constraint that upstream cannot know.

TopicFirst-party sourceHouse subset stays in
Celery settings, serializers, time limits, worker flagshttps://docs.celeryq.dev/en/stable/userguide/configuration.html and .../optimizing.htmlreferences/celery-config.md, rules/jobs-task-queue.md
Queue declarations, router classes, Redis priority mechanicshttps://docs.celeryq.dev/en/stable/userguide/routing.htmlreferences/ork-delta.md
chain / group / chord / signature semanticshttps://docs.celeryq.dev/en/stable/userguide/canvas.htmlrules/celery-canvas.md keeps the house canvas subset. Its si()-in-chords guidance is UNVERIFIED and contested: confirm the argument-passing behaviour against the upstream canvas page before relying on it
autoretry_for, retry_backoff, Reject, task base classeshttps://docs.celeryq.dev/en/stable/userguide/tasks.htmlreferences/ork-delta.md, rules/jobs-task-queue.md
Beat schedules, crontab syntax, DatabaseSchedulerhttps://docs.celeryq.dev/en/stable/userguide/periodic-tasks.html and https://django-celery-beat.readthedocs.io/en/latest/rules/jobs-scheduling.md keeps our beat_schedule shapes; references/ork-delta.md keeps the process model
Flower flags, inspect, signal nameshttps://docs.celeryq.dev/en/stable/userguide/monitoring.html, https://docs.celeryq.dev/en/stable/userguide/signals.html, https://flower.readthedocs.io/en/latest/config.htmlreferences/ork-delta.md
Result backend, AsyncResult, custom stateshttps://docs.celeryq.dev/en/stable/userguide/configuration.htmlrules/jobs-monitoring.md keeps our status endpoints and update_state() usage
Per-task rate_limit, control.rate_limit, Redis Luahttps://docs.celeryq.dev/en/stable/userguide/workers.html, https://redis.io/docs/latest/develop/programmability/eval-intro/references/ork-delta.md
ARQ WorkerSettings, enqueue_job, _defer_by / _defer_until, Job statushttps://arq-docs.helpmanual.io/rules/jobs-task-queue.md keeps the worker skeleton; references/ork-delta.md keeps the budgets
FastAPI lifespan and dependency wiringhttps://fastapi.tiangolo.com/advanced/events/references/ork-delta.md
Distributed locks with SET NX EXhttps://redis.io/docs/latest/commands/set/references/ork-delta.md

Configuration

Load: Read("references/celery-config.md").

DecisionRecommendation
SerializerJSON (never pickle)
Ack modeLate ack (task_acks_late=True)
Prefetch1 for fair, 4-8 for throughput
Time limitsoft < hard (540 / 600)
TimezoneUTC always

Task Routing

DecisionRecommendation
Queue count5: critical / high / default / low / bulk
Priority levels0-9, with all four Redis priority switches set together
Worker assignmentDedicated worker per queue
Prefetch1 critical, 2 high, 4 default, 8 low/bulk
RoutingRouter class once past 5 routing rules

Canvas Workflows

Load: Read("rules/celery-canvas.md").

DecisionRecommendation
SequentialChain with s()
ParallelGroup for independent tasks
Fan-inChord (all header tasks must succeed for the body to run)
Ignore inputUse si() immutable signature
Error in chainReject stops the chain, retry continues it
Partial failuresReturn an error dict from chord header tasks

Retry Strategies

DecisionRecommendation
Retry delayExponential backoff, jitter on, capped at 600s
Max retries3-5 for transient, 0 for permanent
IdempotencyRedis marker (86400s TTL) plus the vendor idempotency key
Failed tasksDLQ for manual review
SingletonRedis lock with a TTL longer than the hard time limit

Scheduling

Load: Read("rules/jobs-scheduling.md").

DecisionRecommendation
Schedule typeCrontab for time-based, float interval for frequency
DynamicDatabaseScheduler (django-celery-beat)
OverlapRedis lock, 3600s default and 7200s for long jobs
Beat processSeparate process; embedded --beat is development only
TimezoneUTC always

Monitoring

DecisionRecommendation
DashboardFlower with persistent storage
MetricsPrometheus wired to task_prerun / task_postrun / task_failure
HealthBroker reachable, at least one worker, queue depths
Alertingcritical > 100, default > 5000, workers < 1
AutoscaleQueue depth > 500

Result Backends

Load: Read("rules/jobs-monitoring.md").

DecisionRecommendation
Status storageRedis result backend, status and small JSON only
Large resultsS3 or database, task returns a reference dict
ProgressCustom states with update_state()
Result queryAsyncResult with state checks

ARQ Patterns

Load: Read("rules/jobs-task-queue.md").

DecisionRecommendation
Simple asyncARQ (native async), max_jobs=10, job_timeout=300
Pool ownershipFastAPI lifespan, never a per-request create_pool
Complex workflowsCelery (chains, chords, DLQ, per-task rate limits)
In-process quickFastAPI BackgroundTasks, under 30s, non-critical only
LLM workflowsLangGraph, not Celery

Tool Selection

Load: Read("references/quick-start-examples.md") for the full tool comparison table (ARQ, Celery, RQ, Dramatiq, FastAPI BackgroundTasks).

Anti-Patterns (FORBIDDEN)

Load details: Read("references/anti-patterns.md") for the full list.

Key rules: never run long tasks in request handlers, never block on results inside tasks, never store large results in Redis, always use idempotency for retried tasks.

Temporal Workflows

Load: Read("rules/temporal-workflows.md").

DecisionRecommendation
Workflow IDBusiness-meaningful, idempotent
DeterminismUse workflow.random(), workflow.now()
I/OAlways via activities, never directly

Temporal Activities

Load: Read("rules/temporal-activities.md").

DecisionRecommendation
Activity timeoutstart_to_close for most cases
Error handlingNon-retryable for business errors
TestingWorkflowEnvironment.start_local() for integration tests

Related Skills

  • ork:python-backend - FastAPI, asyncio, SQLAlchemy patterns
  • ork:langgraph - LangGraph workflow patterns (use for LLM workflows, not Celery)
  • ork:distributed-systems - Resilience patterns, circuit breakers
  • ork:monitoring-observability - Metrics and alerting

Capability Details

Load details: Read("references/capability-details.md") for the keyword index and problem-to-capability mapping.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Async Jobs làm được gì?

Async job processing patterns for background tasks, Celery workflows, task scheduling, retry strategies, and distributed task execution. Use when implementing background job processing, task queues, or scheduled task systems.

Vì sao nên dùng Async Jobs trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Async Jobs là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Async Jobs trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/yonatangross/orchestkit/tree/main/plugins/ork/skills/async-jobs. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Async Jobs?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Async Jobs với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Async Jobs với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Async Jobs có miễn phí không?

Có. Kỹ năng này được yonatangross phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇