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-1.0.0.tar.gz
(12.5 kB
view hashes)
Built Distribution
Close
Hashes for dramatiq_abort-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f4eb54363169eb4b8907176d26a86b364bbe6b77f5c99f5ea23b9ae60c406da |
|
MD5 | 802b14dc340e412af7010896950f2aa4 |
|
BLAKE2b-256 | d98be1b6adba233b8cac3361457704f96afe5b0a7887c6989281392f354b19f0 |