Full Observability
Every task in AsyncQueue carries its full execution history. You always know the current status, how many retries occurred, the callback response, and the exact timing.
Task status tracking
Section titled “Task status tracking”Each task has a status that updates as it progresses:
| Status | Meaning |
|---|---|
pending | Queued and waiting for a worker |
delayed | Scheduled for future execution |
processing | Worker is executing the callback |
waiting | Callback succeeded, awaiting an external signal |
completed | Callback returned a response (2xx, 3xx, or 4xx) |
failed | All retry attempts exhausted |
timeout | Exceeded the configured maxWaitTime |
cancelled | Cancelled before processing started |
Execution details
Section titled “Execution details”Completed tasks include the full callback response:
{ "task": { "status": "completed", "retryCount": 1, "result": { "statusCode": 200, "headers": {"content-type": "application/json"}, "body": "{\"processed\": true}", "duration": 2341 }, "createdAt": "2024-01-15T10:30:00.000Z", "startedAt": "2024-01-15T10:30:01.000Z", "completedAt": "2024-01-15T10:30:03.341Z" }}Failed tasks include the error message:
{ "task": { "status": "failed", "retryCount": 3, "error": "Server error: HTTP 500 - Internal Server Error", "createdAt": "2024-01-15T10:30:00.000Z", "completedAt": "2024-01-15T10:31:15.000Z" }}Long polling for real-time updates
Section titled “Long polling for real-time updates”Track a task until it finishes with the wait parameter. The API holds the connection (up to 25 seconds) and returns immediately when the task status changes:
# Wait up to 20 seconds for a status changecurl "https://api.asyncqueue.io/v1/tasks/550e8400-e29b-41d4-a716-446655440000?wait=20" \ -H "Authorization: Bearer your-api-key"If the status changes during the wait window, the response is returned instantly. If it does not change within the timeout, the current state is returned and you can reconnect. This gives near-instant updates without the overhead of constant polling.
Filtering and listing
Section titled “Filtering and listing”Query tasks by status, with pagination:
# All failed taskscurl "https://api.asyncqueue.io/v1/tasks?status=failed&limit=100" \ -H "Authorization: Bearer your-api-key"
# Recent tasks, newest firstcurl "https://api.asyncqueue.io/v1/tasks?sortOrder=desc&limit=20" \ -H "Authorization: Bearer your-api-key"Questions you can answer
Section titled “Questions you can answer”- How many tasks are pending right now?
- Which tasks failed in the last hour and why?
- How long did a specific callback take to respond?
- How many retries did a task need before succeeding?
- What was the exact response from the callback endpoint?