Dramatiq middleware to abort tasks.
Project description
dramatiq-abort
Add the aborting feature to dramatiq through a simple middleware with flexible backend.
Current version support aborting using the Redis store.
Installation
Since the only available backend right now is Redis:
pip install dramatiq_abort[redis]
Quickstart
from dramatiq import get_broker
from dramatiq_abort import Abortable, backends, abort
abortable = Abortable(backend=backends.RedisBackend())
get_broker.add_middleware(abortable)
# ...
import dramatiq
@dramatiq.actor
def my_long_running_task(): ...
message = my_long_running_task.send()
# Now abort the message.
abort(message.message_id)
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
dramatiq-abort-0.1b0.tar.gz
(8.3 kB
view hashes)
Built Distribution
Close
Hashes for dramatiq_abort-0.1b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2211dc805040c726a9b9d44e25638434e3a452c436542b8c1d770422f54d39a9 |
|
MD5 | deb9240562dab61203fca4b6d6512319 |
|
BLAKE2b-256 | ed2c42d50c92a84ead8222a93e8f5adf17210152613a9dfe0bbb2cfeead02d6f |