Add vercel-celery -- Vercel Queues backend for Kombu and Runtime Cache storage backend for Celery#159
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
elprans
force-pushed
the
elprans/vq-celery
branch
from
July 8, 2026 20:56
b3c1db2 to
a43edc8
Compare
ricardo-agz
approved these changes
Jul 8, 2026
elprans
force-pushed
the
elprans/vq-celery
branch
from
July 9, 2026 02:30
a43edc8 to
ed23b71
Compare
elprans
force-pushed
the
elprans/vq-celery
branch
from
July 9, 2026 04:09
ed23b71 to
d6abc0a
Compare
elprans
force-pushed
the
elprans/vq-celery
branch
from
July 9, 2026 04:51
0d9d5f9 to
5a060b7
Compare
elprans
force-pushed
the
elprans/vq-celery
branch
from
July 9, 2026 05:10
5a060b7 to
d9110cd
Compare
elprans
force-pushed
the
elprans/vq-celery
branch
from
July 9, 2026 05:23
d9110cd to
4684b9e
Compare
elprans
force-pushed
the
elprans/vq-celery
branch
from
July 9, 2026 05:29
4684b9e to
d3d2671
Compare
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.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds Kombu
Transportimplementations that work inpushandpollmode. To use, install thevercel-celerypackage and callinstall_vercel_celery_integration:This registers three Kombu transport aliases:
vercel://-- automatically chooses push/pull mode by detectingwhether code is deployed on Vercel (by checking for
VERCELin env);vercel-push://-- explicit push transport, registers the queuecallbacks via normal
vercel.queuesubscription mechanisms;vercel-poll://-- explicit poll transport, will always poll formessages.
Additionally, the installation function will set the default Celery
broker URL to
vercel://(but only if it is yet unconfigured) andautomatically register all Celery queues as corresponding Vercel Queues
topic subscribers. Users can opt out of either behavior by passing
set_default_broker=Falseandregister_queues=Falsecorrespondingly.The installation function also registers
vercel-runtime-cache://as aCelery 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 localfallback 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_expiresvalue astheir Runtime Cache TTL by default, or
result_backend_transport_options["ttl"]when configured.