Git Product home page Git Product logo

fastapi-cloud-tasks's Issues

.delay() shoud be async

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

Question: Is the project abandoned, and do you need help?

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.