Skip to main content

design-a-background-task-runner

Design a background task runner with durable identity, idempotency, scheduling, retries, leases, cancellation, observability, and recovery. Use when work must continue safely outside a request.

소스 정보

저장소
protosphinx/sphinxstack
최근 소스 활동
2026년 7월 29일 13:55
감지된 SKILL.md 언어
영어
스타
3
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
design-a-background-task-runner
category
code
description
Design a background task runner with durable identity, idempotency, scheduling, retries, leases, cancellation, observability, and recovery. Use when work must continue safely outside a request.
# design-a-background-task-runner Assume every task can be delayed, duplicated, interrupted, or retried. ## When to use - Use for jobs, workflows, scheduled work, imports, exports, notifications, or maintenance. - Do not put irreversible side effects behind unbounded automatic retries. ## Preconditions - Define task types, producers, consumers, deadlines, volume, ordering, side effects, recovery, and data boundaries. ## Procedure 1. Specify durable task ID, payload version, tenant, priority, schedule, deadline, and idempotency key. 2. Define enqueue transaction, visibility, lease, heartbeat, concurrency, ordering, and ownership. 3. Make handlers replay-safe and fence external side effects with durable receipts. 4. Classify retryable, terminal, canceled, expired, and poison failures with bounded backoff. 5. Add dead-letter review, redrive authority, compensation, and manual recovery. 6. Design graceful drain, deploy compatibility, schema evolution, and disaster recovery. 7. Instrument queue age, starts, duration, retries, failures, saturation, and outcome. 8. Test crash-before, crash-after, duplicate, timeout, stale lease, poison, cancellation, and recovery. ## Failure plan - Stop intake or isolate a task type when retries increase harm or obscure state. ## Worked example An invoice export writes one durable outcome receipt before sending, so a worker crash cannot send the same export twice. ## Done - A task-runner design document records identity, state, leases, idempotency, retries, cancellation, recovery, deployment, and telemetry - Duplicate, crash-window, poison, saturation, schema, drain, redrive, and side-effect tests verify the design
GitHub에서 보기