Skip to main content

Azure Queue Brokers for Dramatiq

Project description

dramatiq-azure

CI Pypi codecov Code style: black PRs Welcome

A Dramatiq broker that can be used with Microsoft Azure queue services.

Heavily inspired by Dramatiq SQS, this package currently implements a broker for Azure Storage Queue. An implementation for Azure Service Bus is planned... eventually.

Installation

    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.

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 instance. You can easily launch azurite through Docker.

docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 mcr.microsoft.com/azure-storage/azurite

Run the test suite

pytest

Contributions

Found an itch you know how to scratch? PR welcome

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_azure-0.2.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dramatiq_azure-0.2.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file dramatiq_azure-0.2.0.tar.gz.

File metadata

  • Download URL: dramatiq_azure-0.2.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.9.17 Linux/5.15.0-1041-azure

File hashes

Hashes for dramatiq_azure-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1cc5f678bda5f4b41cc03a4ad10785fa04024f7280171c811462eb37eaf01657
MD5 fdd477a34ab525455044d976cde8e91f
BLAKE2b-256 812fca9bfe058a874f25ccec5910de8e426eb1880923b99a4dc88a0ecbd54f4f

See more details on using hashes here.

File details

Details for the file dramatiq_azure-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dramatiq_azure-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.9.17 Linux/5.15.0-1041-azure

File hashes

Hashes for dramatiq_azure-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8fd4931f6835d14f273a07d39ba8828fc7565fb7238bda08d702c45e29e2e3c6
MD5 346a5ebd60daec385b55b0c9e2daadba
BLAKE2b-256 59cd3ef1c1872a3bc3d7a2cf458324ef747238d0bb2b4297d0bdbceeb02846cb

See more details on using hashes here.

Supported by

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