BullMQ for Python
Project description
BullMQ For Python
This is the official BullMQ Python library. It is a close port of the NodeJS version of the library. Python Queues are interoperable with NodeJS Queues, as both libraries use the same .lua scripts that power all the functionality.
Features
Currently, the library does not support all the features available in the NodeJS version. The following have been ported so far:
-
Add jobs to queues.
- Regular jobs.
- Delayed jobs.
- Job deduplication.
- Job priority.
- Repeatable.
-
Workers
-
Job events.
-
Job progress.
-
Job retries.
-
Job backoff.
-
Getters.
Installation
pip install bullmq
Usage
Basic Example
from bullmq import Queue
queue = Queue('my-queue')
job = await queue.add('my-job', {'foo': 'bar'})
Job Deduplication
Prevent duplicate jobs from being added to the queue:
from bullmq import Queue
queue = Queue('my-queue')
# Simple mode - deduplicates until job completes or fails
job = await queue.add('paint', {'color': 'white'}, {
'deduplication': {
'id': 'custom-dedup-id'
}
})
# Throttle mode - deduplicates for a specific time window (in milliseconds)
job = await queue.add('paint', {'color': 'white'}, {
'deduplication': {
'id': 'custom-dedup-id',
'ttl': 5000 # 5 seconds
}
})
# Debounce mode - replaces pending job with latest data
job = await queue.add('paint', {'color': 'white'}, {
'deduplication': {
'id': 'custom-dedup-id',
'ttl': 5000,
'extend': True, # Extend TTL on each duplicate attempt
'replace': True # Replace job data with latest
},
'delay': 5000 # Must be delayed for replace to work
})
Documentation
The documentation is available at https://docs.bullmq.io
License
MIT
Copyright
Copyright (c) 2018-2023, Taskforce.sh Inc. and other contributors.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bullmq-2.19.5.tar.gz.
File metadata
- Download URL: bullmq-2.19.5.tar.gz
- Upload date:
- Size: 784.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cca3607bee732b6313acf81e23b3788ab6b025988cc480e1b47bc2e246c61f40
|
|
| MD5 |
f4696fa1f5c4a7655bcdb6f855b092a6
|
|
| BLAKE2b-256 |
d5e6684e0052991125508c3cdee4fe6d69321bce184dd6dae918090ae5fad1f6
|
File details
Details for the file bullmq-2.19.5-py3-none-any.whl.
File metadata
- Download URL: bullmq-2.19.5-py3-none-any.whl
- Upload date:
- Size: 899.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4597b643282f597d445d9bd75d38d64477c303fce28640f9f294b0b0db94a17c
|
|
| MD5 |
9c0b4a722fd6d4d03cf2ec856204b1f1
|
|
| BLAKE2b-256 |
983c4a57761834c79e9b342dff3a0c13ea8e7eb189f507a4dfd63650e2850d0d
|