dramatiq-azure-0.1.5
توضیحات
Azure Queue Brokers for Dramatiq
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | dramatiq-azure-0.1.5 |
| نام | dramatiq-azure |
| نسخه کتابخانه | 0.1.5 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Stanislas H.B. Sodonon |
| ایمیل نویسنده | stanislas.sodonon@gmail.com |
| آدرس صفحه اصلی | https://github.com/bidossessi/dramatiq-azure |
| آدرس اینترنتی | https://pypi.org/project/dramatiq-azure/ |
| مجوز | Apache-2.0 |
# dramatiq-azure
[](https://github.com/bidossessi/dramatiq-azure/actions/workflows/ci.yml)
[](https://github.com/bidossessi/dramatiq-azure/actions/workflows/python-publish.yml)
[](https://codecov.io/gh/bidossessi/dramatiq-azure)
[](https://bettercodehub.com/)
[](https://lgtm.com/projects/g/bidossessi/dramatiq-azure/alerts/)
[](https://github.com/psf/black)
[](https://makeapullrequest.com)
A [Dramatiq](https://dramatiq.io) broker that can be used with [Microsoft Azure](https://azure.microsoft.com/en-us/) queue services.
Heavily inspired by [Dramatiq SQS](https://github.com/Bogdanp/dramatiq_sqs), this package currently implements a broker for [Azure Storage Queue](https://docs.microsoft.com/en-us/azure/storage/queues/).
An implementation for [Azure Service Bus](https://docs.microsoft.com/en-us/azure/service-bus-messaging/) is planned... eventually.
## Installation
```shell
pip install dramatiq-azure
```
## Usage
### ASQBroker
The broker looks for `AZURE_STORAGE_CONNECTION_STR` in the environment, to authenticate on Azure Storage.
You need to make sure that the variable exists at runtime.
Creating a connection string for your Azure account is documented [here](https://docs.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string).
```python
import os
import dramatiq
from dramatiq.middleware import AgeLimit, TimeLimit, Callbacks, Pipelines, Prometheus, Retries
from dramatiq_azure import ASQBroker
broker = ASQBroker(
dead_letter=True,
middleware=[
Prometheus(),
AgeLimit(),
TimeLimit(),
Callbacks(),
Pipelines(),
Retries(min_backoff=1000, max_backoff=900000, max_retries=96),
],
)
dramatiq.set_broker(broker)
```
## Tests
Tests require a running [Azurite](https://github.com/Azure/Azurite) instance. You can easily launch `azurite` through [Docker](https://www.docker.com/).
```shell
docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 mcr.microsoft.com/azure-storage/azurite
```
Run the test suite
```shell
pytest
```
## Contributions
Found an itch you know how to scratch? PR welcome
نیازمندی
| مقدار | نام |
|---|---|
| >=1.20.1,<2.0.0 | azure-core |
| >=12.1.6,<13.0.0 | azure-storage-queue |
| >=1.12.0,<2.0.0 | dramatiq |
| >=2.17.0,<3.0.0 | pre-commit |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7,<4.0 | Python |
نحوه نصب
نصب پکیج whl dramatiq-azure-0.1.5:
pip install dramatiq-azure-0.1.5.whl
نصب پکیج tar.gz dramatiq-azure-0.1.5:
pip install dramatiq-azure-0.1.5.tar.gz