Skip to content

Add vercel-celery -- Vercel Queues backend for Kombu and Runtime Cache storage backend for Celery#159

Merged
elprans merged 1 commit into
mainfrom
elprans/vq-celery
Jul 10, 2026
Merged

Add vercel-celery -- Vercel Queues backend for Kombu and Runtime Cache storage backend for Celery#159
elprans merged 1 commit into
mainfrom
elprans/vq-celery

Conversation

@elprans

@elprans elprans commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

This adds Kombu Transport implementations that work in push and
poll mode. To use, install the vercel-celery package and call
install_vercel_celery_integration:

from vercel.integrations.celery import install_vercel_celery_integration
install_vercel_celery_integration()

This registers three Kombu transport aliases:

  • vercel:// -- automatically chooses push/pull mode by detecting
    whether code is deployed on Vercel (by checking for VERCEL in env);

  • vercel-push:// -- explicit push transport, registers the queue
    callbacks via normal vercel.queue subscription mechanisms;

  • vercel-poll:// -- explicit poll transport, will always poll for
    messages.

Additionally, the installation function will set the default Celery
broker URL to vercel:// (but only if it is yet unconfigured) and
automatically register all Celery queues as corresponding Vercel Queues
topic subscribers. Users can opt out of either behavior by passing
set_default_broker=False and register_queues=False correspondingly.

The installation function also registers vercel-runtime-cache:// as a
Celery result backend and sets it as the default result backend when
Celery has not already configured one. This uses Vercel Runtime Cache
through vercel.cache, including its key hashing, namespacing, and local
fallback behavior. Users can opt out of the default result backend by
passing set_default_result_backend=False.

Runtime Cache is an expiring, cache-backed backend rather than durable
result storage. Stored results use Celery's result_expires value as
their Runtime Cache TTL by default, or
result_backend_transport_options["ttl"] when configured.

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vercel-py Ready Ready Preview Jul 10, 2026 5:43am

Request Review

@socket-security

socket-security Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpypi/​celery@​5.6.397100100100100

View full report

Base automatically changed from elprans/vercel-queues to main July 9, 2026 00:00
@elprans
elprans force-pushed the elprans/vq-celery branch from a43edc8 to ed23b71 Compare July 9, 2026 02:30
@elprans
elprans changed the base branch from main to elprans/cache-strict-mode July 9, 2026 02:30
Base automatically changed from elprans/cache-strict-mode to main July 9, 2026 04:08
@elprans
elprans force-pushed the elprans/vq-celery branch from ed23b71 to d6abc0a Compare July 9, 2026 04:09
@elprans
elprans force-pushed the elprans/vq-celery branch from 0d9d5f9 to 5a060b7 Compare July 9, 2026 04:51
@elprans
elprans force-pushed the elprans/vq-celery branch from 5a060b7 to d9110cd Compare July 9, 2026 05:10
@elprans
elprans force-pushed the elprans/vq-celery branch from d9110cd to 4684b9e Compare July 9, 2026 05:23
@elprans
elprans force-pushed the elprans/vq-celery branch from 4684b9e to d3d2671 Compare July 9, 2026 05:29
This adds Kombu `Transport` implementations that work in `push` and
`poll` mode.  To use, install the `vercel-celery` package and call
`install_vercel_celery_integration`:

    from vercel.integrations.celery import install_vercel_celery_integration
    install_vercel_celery_integration()

This registers three Kombu transport aliases:

- `vercel://` -- automatically chooses push/pull mode by detecting
  whether code is deployed on Vercel (by checking for `VERCEL` in env);

- `vercel-push://` -- explicit push transport, registers the queue
  callbacks via normal `vercel.queue` subscription mechanisms;

- `vercel-poll://` -- explicit poll transport, will always poll for
  messages.

Additionally, the installation function will set the default Celery
broker URL to `vercel://` (but only if it is yet unconfigured) and
automatically register all Celery queues as corresponding Vercel Queues
topic subscribers.  Users can opt out of either behavior by passing
`set_default_broker=False` and `register_queues=False` correspondingly.

The installation function also registers `vercel-runtime-cache://` as a
Celery result backend and sets it as the default result backend when
Celery has not already configured one.  This uses Vercel Runtime Cache
through `vercel.cache`, including its key hashing, namespacing, and local
fallback behavior.  Users can opt out of the default result backend by
passing `set_default_result_backend=False`.

Runtime Cache is an expiring, cache-backed backend rather than durable
result storage.  Stored results use Celery's `result_expires` value as
their Runtime Cache TTL by default, or
`result_backend_transport_options["ttl"]` when configured.
@elprans elprans mentioned this pull request Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants