apscheduler integration#168
Draft
ricardo-agz wants to merge 4 commits into
Draft
Conversation
This adds Kombu `Transport` implementations that work in `push` and
`poll` mode. To use, install the `vercel-celery-broker` 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.
|
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.
|
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.
No description provided.