Quick Start¶
Get TaskMQ running in under 5 minutes.
Prerequisites¶
- Python 3.8 or higher
- pip package manager
Installation¶
For Redis support:
Step 1: Start a Worker¶
Open a terminal and start a worker process:
You should see:
Step 2: Add a Job¶
Open another terminal and add a job:
Output:
Step 3: Check Job Status¶
Output:
Job ID: 1
Status: success
Priority: 0
Payload: {"message": "Hello, World!"}
Result: {'executed': True, 'job_id': 1}
Retries: 0
Step 4: Start the API Server¶
Visit http://127.0.0.1:8000/docs for interactive API documentation.
Using Redis Backend¶
For production workloads, use Redis:
# Start worker with Redis
taskmq --backend redis --redis-url redis://localhost:6379/0 run-worker
# Add job with Redis
taskmq --backend redis --redis-url redis://localhost:6379/0 add-job --payload '{"task": "test"}' --handler dummy
Running Tests¶
Next Steps¶
- Usage Guide - Learn about all CLI commands and options
- Writing Handlers - Create custom job handlers
- API Reference - Use the REST API