Skip to main content

vercel-dramatiq

Dramatiq broker backed by Vercel Queue Service.

# tasks.py
import dramatiq

from vercel.integrations.dramatiq import VercelQueueBroker

broker = VercelQueueBroker()
dramatiq.set_broker(broker)


@dramatiq.actor
def send_email(user_id: str) -> None: ...

Constructing the broker explicitly is the recommended pattern: it always takes effect and the broker options are visible at the construction site. To store actor results in Vercel Runtime Cache, add the results middleware:

from dramatiq.results import Results

from vercel.integrations.dramatiq import VercelRuntimeCacheBackend

broker.add_middleware(Results(backend=VercelRuntimeCacheBackend()))

Alternatively, install_vercel_dramatiq_integration() sets Dramatiq's global broker to a default VercelQueueBroker with the results middleware when no broker has been configured yet. Note that this is a no-op once a global broker exists, so broker options passed to the installer do not apply in environments that install the integration first (Vercel functions do).

The broker uses push delivery when VERCEL is truthy in the environment and poll delivery otherwise. Pass poll=False or poll=True to VercelQueueBroker(...) to force a mode.

For Vercel push delivery, declare a module that exposes the broker as a queue subscriber in pyproject.toml:

# worker.py
# Importing tasks declares the actors' queues on the broker.
from tasks import broker

__all__ = ["broker"]
[[tool.vercel.subscribers]]
entrypoint = "worker:broker"

The Vercel build introspects every queue declared on the broker and compiles the subscriber into a queue-triggered function. That includes each queue's Dramatiq delay queue: the default queue maps to both the default topic and the sanitized default_DDQ delay topic, and retries and delayed messages are delivered through the delay queue topic.

Set VERCEL_DRAMATIQ_DEBUG=1 to enable debug logging for the integration and Dramatiq worker loggers.

The package is standalone and depends on vercel-queue and Dramatiq.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vercel_dramatiq-0.7.3.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

vercel_dramatiq-0.7.3-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file vercel_dramatiq-0.7.3.tar.gz.

File metadata

  • Download URL: vercel_dramatiq-0.7.3.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for vercel_dramatiq-0.7.3.tar.gz
Algorithm Hash digest
SHA256 e2527cf5249667589c845755b895ebb378e3d5c84b6840a1d8c5d377dd20aeb3
MD5 3ecf029f7988a7054735b300400520cf
BLAKE2b-256 34a0812d1893d8de17f93c63d94dba7a62cceadbd56ab652787e8f1f77fcbd59

See more details on using hashes here.

File details

Details for the file vercel_dramatiq-0.7.3-py3-none-any.whl.

File metadata

  • Download URL: vercel_dramatiq-0.7.3-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for vercel_dramatiq-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8369621af875a7fef4a6ea134b1bc02cde9af4abc3117763f1cdc7510626073b
MD5 bb0fddff65ed89ea7e29a35014f1dbe9
BLAKE2b-256 acf03e14713bf82aa7cd237023cf11df15255926490647a96a169da95b52a724

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.7.3 This release

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page