Skip to content

Commit

Permalink
Add documentation snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
isra17 committed Dec 25, 2019
1 parent 690de8a commit e1eb63e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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]


## 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/

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def rel(*xs: str) -> str:
"Topic :: System :: Distributed Computing",
(
"License :: OSI Approved :: "
"GNU Lesser General Public License v3 or later (LGPLv3+)",
"GNU Lesser General Public License v3 or later (LGPLv3+)"
),
],
)

0 comments on commit e1eb63e

Please sign in to comment.