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.4.0.tar.gz
(11.9 kB
view hashes)
Built Distribution
Close
Hashes for dramatiq_abort-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68085ed92f02a441c3a54f0e26716e3790ddd5225ab8386ad64e7cc62104848c |
|
MD5 | 223cdd1dbfeb9d1602fdc73714ec0b5f |
|
BLAKE2b-256 | 61fe0860dda79d982ab1da65c09820593cac2596409a8af220bba9cacaaf09bb |