adori / fastapi-cloud-tasks Goto Github PK
View Code? Open in Web Editor NEWGCP's Cloud Tasks + Cloud Scheduler + FastAPI = Partial replacement for celery.
License: MIT License
GCP's Cloud Tasks + Cloud Scheduler + FastAPI = Partial replacement for celery.
License: MIT License
How would you deploy this?
Hi @ofpiyush, are you still maintaining this library?
The library is very useful, and I'm not actually missing features, but it is a little difficult to use the library with the latest developments in Pydantic and FastAPI, and it would be nice to either get an official patch with #8 or a more permanent fix/update.
Thank you for this library, and if you need any help with maintenance, let me know.
The example in README shows how to queue a task with sync .delay()
function, which is not a good idea in async handler.
We have remote IO there: usually low-latency, but no warranty. So .delay()
blocks asyncio loop when called from async route.
README presents examples with async routes calling sync .delay()
call example (e.g. "https://github.com/Adori/fastapi-cloud-tasks#local"). This might be misleading for a less experienced user.
Making .delay(...)
async would allow to call
await make_dinner.delay(...)
or even
task = create_task(make_dinner.delay(...))
# make something else here in the meanwhile
# ...
# ensure the task was enqueued before the request has been finalized
await task
Cloud Tasks library already provides async variant of the client for some time, and it works well:
https://cloud.google.com/python/docs/reference/cloudtasks/latest/google.cloud.tasks_v2.services.cloud_tasks.CloudTasksAsyncClient
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.