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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2527cf5249667589c845755b895ebb378e3d5c84b6840a1d8c5d377dd20aeb3
|
|
| MD5 |
3ecf029f7988a7054735b300400520cf
|
|
| BLAKE2b-256 |
34a0812d1893d8de17f93c63d94dba7a62cceadbd56ab652787e8f1f77fcbd59
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8369621af875a7fef4a6ea134b1bc02cde9af4abc3117763f1cdc7510626073b
|
|
| MD5 |
bb0fddff65ed89ea7e29a35014f1dbe9
|
|
| BLAKE2b-256 |
acf03e14713bf82aa7cd237023cf11df15255926490647a96a169da95b52a724
|