Skip to main content

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.

Build Status PyPI version Documentation

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


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.1.0.tar.gz (14.5 kB view hashes)

Uploaded Source

Built Distribution

dramatiq_abort-1.1.0-py3-none-any.whl (12.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page