Metadata-Version: 2.1
Name: dramatiq-abort
Version: 1.0.0
Summary: Dramatiq middleware to abort tasks.
Home-page: https://github.com/flared/dramatiq-abort
Author: Flare Systems Inc.
Author-email: oss@flare.systems
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Development Status :: 4 - Beta
Classifier: Topic :: System :: Distributed Computing
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
Description-Content-Type: text/markdown
Provides-Extra: gevent
Provides-Extra: redis
Provides-Extra: all
Provides-Extra: dev
License-File: LICENSE

# 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](https://github.com/Flared/dramatiq-abort/workflows/Push/badge.svg)](https://github.com/Flared/dramatiq-abort/actions?query=workflow%3A%22Push%22)
[![PyPI version](https://badge.fury.io/py/dramatiq-abort.svg)](https://badge.fury.io/py/dramatiq-abort)
[![Documentation](https://img.shields.io/badge/doc-latest-brightgreen.svg)](http://flared.github.io/dramatiq-abort)

## Installation

Since the only available backend right now is [Redis]:

    pip install dramatiq_abort[redis]

**Documentation**: http://flared.github.io/dramatiq-abort


## Quickstart

```python

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)
```

[Redis]: https://redis.io
[dramatiq]: https://dramatiq.io/

