Basic Usage
python
CLI Usage
You can interact with ModelQ using themodelq
command-line tool. All commands require an --app-path
parameter to locate your ModelQ instance in module:object
format.
Start Workers
Start background worker threads for executing tasks.
Check Queue Status
List Queued Tasks
Clear the Queue
Remove a Specific Task
Serve API
Version
Pydantic Support
ModelQ supports Pydantic models as both input and output types for tasks. This allows automatic validation of input parameters and structured return values.Example
python
Getting Result
python
Middleware Support
ModelQ allows you to plug in custom middleware to hook into events:Supported Events
before_worker_boot
after_worker_boot
before_worker_shutdown
after_worker_shutdown
before_enqueue
after_enqueue
on_error
Example
python
Attach to ModelQ instance:
python
Configuration
Connect to Redis using custom config:python