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.2.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.2-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vercel_dramatiq-0.7.2.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.2.tar.gz
Algorithm Hash digest
SHA256 f462cba3455be60fa726b0228a5a9e44016e3a7956d83a9b6dd3008969631bac
MD5 277fb8e889154466b4c253f1a325a2b3
BLAKE2b-256 e85a61b8de0f06192b5be5ac94289866761e8da448b5057d41465a9cd9201bb1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vercel_dramatiq-0.7.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d0bfdce1b86e6cfc3e6caa5c305ad0a15ba0e993018d68e030246451a692760b
MD5 2a79d904a8b0d57234eed31a8b4650f3
BLAKE2b-256 497e638e4e4c82300725050403f7ae18364784ddc7adaeded72d3e03eda8b716

See more details on using hashes here.

Release history Release notifications | RSS feed

0.7.3

2 files

This release

0.7.2 This release

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