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]
Documentation: http://flared.github.io/dramatiq-abort
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.2.tar.gz
(10.9 kB
view hashes)
Built Distribution
Close
Hashes for dramatiq_abort-0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c323f542e0ba44f12955bdfd18485c0334af71255a464ef251e48847c7fd0bb2 |
|
MD5 | 087d3134625fec9612d3af6a4eb2551b |
|
BLAKE2b-256 | 3d879e85c2a6efc35bb30078692bca39f24ae0db9bc6049fb6b0499febdd8737 |