Execution
queue
Task and job queue management
queue
Distributed task and job queue for background processing, scheduled jobs, and rate-limited operations with retries and dead-letter queues.
Overview
The queue primitive provides reliable background job processing with automatic retries, priority queues, delayed execution, and monitoring for long-running or rate-limited tasks.
Quick Example
import { queue } from 'sdk.do'
// Enqueue job
await queue.push('send-email', {
to: '[email protected]',
subject: 'Welcome!',
template: 'welcome',
})
// Process jobs
queue.process('send-email', async (job) => {
await sendEmail(job.data)
})
// Schedule job
await queue.schedule('daily-report', '0 9 * * *', {
recipients: ['[email protected]'],
})Core Capabilities
- Background Processing - Execute jobs asynchronously
- Retries & DLQ - Automatic retries and dead-letter queue
- Scheduled Jobs - Cron-based job scheduling
- Priority Queues - Process high-priority jobs first
- Rate Limiting - Control job execution rate
Access Methods
SDK
TypeScript/JavaScript library for queue operations
await queue.push('send-email', { to: '[email protected]', subject: 'Welcome!' })CLI
Command-line tool for queue management
do queue push send-email --data '{"to":"[email protected]","subject":"Welcome!"}'API
REST/RPC endpoints for queue operations
curl -X POST https://api.do/v1/queue/send-email -d '{"to":"[email protected]"}'MCP
Model Context Protocol for AI-driven queue operations
Enqueue a send-email job with recipient [email protected] and subject "Welcome!"