Skip to main content

vercel-dramatiq-bundle

This is a version of vercel-dramatiq with third-party dependencies bundled. For normal use, install the unbundled vercel-dramatiq package instead: https://pypi.org/project/vercel-dramatiq/

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.

Release files for vercel-dramatiq-bundle 0.7.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vercel-dramatiq-bundle 0.7.3
File Size Uploaded
vercel_dramatiq_bundle-0.7.3.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vercel-dramatiq-bundle 0.7.3
File Interpreter ABI Platform
vercel_dramatiq_bundle-0.7.3-py3-none-any.whl Python 3 none any Details

Total release size: 19.0 kB

Release files / vercel_dramatiq_bundle-0.7.3.tar.gz

Download URL vercel_dramatiq_bundle-0.7.3.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8085a61309ce1d182f5912fadb11db9faf19bedccbfa6830b5faafd26cc81597
BLAKE2b-256 checksum
How to use checksums
6948ba11f7d9a326c6d4025a916fd81aa25616c3c58f03f4e965ef46a9c8699a
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / vercel_dramatiq_bundle-0.7.3-py3-none-any.whl

Download URL vercel_dramatiq_bundle-0.7.3-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e83da8e2683673fe9cfe784543d412683a5368669dfc2414b0337c12f8d2d62d
BLAKE2b-256 checksum
How to use checksums
004af3dc583384309fca60c32b59f0e8b9b5bd34fa16c289c0ffa1d69435a83a
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

0.7.6

2 release files

This release

0.7.3 This release

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release 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