Python SDK for Vercel Workers
Project description
vercel-workers
Installation
pip install vercel-workers
Django 6.0 django.tasks integration (Vercel Queues)
This repo ships an optional django.tasks backend that enqueues tasks into Vercel Queues and
executes them via a queue callback route (similar in spirit to the Celery integration in this repo).
Install
pip install "vercel-workers[django]"
Configure Django
In settings.py:
TASKS = {
"default": {
"BACKEND": "vercel.workers.django.backend.VercelQueuesBackend",
# Optional: restrict which Django queue_name values are allowed.
"QUEUES": ["default"],
"OPTIONS": {
# TaskResult storage (uses Django cache; for production prefer Redis).
"cache_alias": "default",
"result_ttl_seconds": 86400,
# Callback execution settings (visibility/lease).
"visibility_timeout_seconds": 30,
"visibility_refresh_interval_seconds": 10.0,
# Basic retry policy for task exceptions.
"max_attempts": 3,
"retry_backoff_base_seconds": 5,
"retry_backoff_factor": 2.0,
# Optional publish-time overrides passed through to vercel.workers.client.send()
# (you can also set env vars like VERCEL_QUEUE_TOKEN / VERCEL_QUEUE_BASE_URL).
# "token": "...",
# "base_url": "...",
# "base_path": "...",
# "retention_seconds": 86400,
# "deployment_id": "...",
# "timeout": 10.0,
},
}
}
Define and enqueue tasks
from django.tasks import task
@task(queue_name="default")
def send_email(to: str) -> None:
...
result = send_email.enqueue(to="user@example.com")
Expose the Vercel Queue callback route
You must expose a WSGI/ASGI endpoint that Vercel Queues can POST CloudEvents to:
- WSGI:
vercel.workers.django.get_wsgi_app(backend_alias="default") - ASGI:
vercel.workers.django.get_asgi_app(backend_alias="default")
How you mount that depends on your deployment setup (Vercel Python entrypoint / framework).
Notes / limitations
- Queue naming: Django
Task.queue_namemaps directly to the Vercel Queue name you publish to. - Priority: not supported (Django Tasks will validate priority is default).
- run_after: supported by delaying the queue message (visibility timeout) when it is delivered early.
- Results: stored in Django cache. With
LocMemCache,get_result()is process-local; for real cross-request results use Redis (or another shared cache backend).
Project details
Release history Release notifications | RSS feed
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_workers-0.0.9.tar.gz.
File metadata
- Download URL: vercel_workers-0.0.9.tar.gz
- Upload date:
- Size: 40.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9baf4cd2cdaf965a00e43ff391522120867ebe6831b6db3664ff4649ff09645d
|
|
| MD5 |
c6dc5b5c4b59893e372238c178cb4d6d
|
|
| BLAKE2b-256 |
7013e98a11b1dc75c4a09e5665e2ec263ad744d36a7cfc63465af889d4b0cc4e
|
Provenance
The following attestation bundles were made for vercel_workers-0.0.9.tar.gz:
Publisher:
publish.yaml on vercel/vqs-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vercel_workers-0.0.9.tar.gz -
Subject digest:
9baf4cd2cdaf965a00e43ff391522120867ebe6831b6db3664ff4649ff09645d - Sigstore transparency entry: 767752574
- Sigstore integration time:
-
Permalink:
vercel/vqs-py@bd418c9ea1e8637f4eb4d8e6d809c41656ed2120 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/vercel
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@bd418c9ea1e8637f4eb4d8e6d809c41656ed2120 -
Trigger Event:
push
-
Statement type:
File details
Details for the file vercel_workers-0.0.9-py3-none-any.whl.
File metadata
- Download URL: vercel_workers-0.0.9-py3-none-any.whl
- Upload date:
- Size: 42.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f66ab51c7f19e84c08b19c0a1450a36b32b37257f2181603360722cb3b1872d
|
|
| MD5 |
f726e97450b489e8bf514be67c44b4f2
|
|
| BLAKE2b-256 |
e9d8584a9b62b1041b5132d2f75663ce82e0de99f76dcd0c246f03cb0af4c6c3
|
Provenance
The following attestation bundles were made for vercel_workers-0.0.9-py3-none-any.whl:
Publisher:
publish.yaml on vercel/vqs-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vercel_workers-0.0.9-py3-none-any.whl -
Subject digest:
1f66ab51c7f19e84c08b19c0a1450a36b32b37257f2181603360722cb3b1872d - Sigstore transparency entry: 767752576
- Sigstore integration time:
-
Permalink:
vercel/vqs-py@bd418c9ea1e8637f4eb4d8e6d809c41656ed2120 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/vercel
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@bd418c9ea1e8637f4eb4d8e6d809c41656ed2120 -
Trigger Event:
push
-
Statement type: