Git Product home page Git Product logo

Comments (8)

s3rius avatar s3rius commented on May 17, 2024 14

Hello, guys. It's been a long ride, but finally taskiq is mature enough to be integrated in fastapi-template.

To close this issue I've created a project, lol, but now I'll be trying to make it more popular and continue developing it. There're some missing features in taskiq, but everything what we plan for future will be implemented.

It doesn't have a docs about how to use it with fastapi in official documentation, please use this README as reference to integrate it in existing projects.

Warm thanks for your patience and have a great hacking.

from fastapi-template.

s3rius avatar s3rius commented on May 17, 2024 3

Hi there. After some research I found out that there is no such thing as celery or dramatiq for async projects. So I've created one. It's called taskiq. Currently it's unstable, but I will try to add this integration after we stabilize all interfaces, add tests, and create more brokers and result backends.

It took only month to build it from scratch. But I guess it may be very helpful project for many people that struggle in search for the async celery alternative.

from fastapi-template.

haffi96 avatar haffi96 commented on May 17, 2024 2

It looks great. Will definitely consider it next time i have a need. Side note, thoughts on adding hacktoberfest tag to the repo? (definitely asking for my own selfish desire to get a badge... 👀 )

from fastapi-template.

sorasful avatar sorasful commented on May 17, 2024 1

Hey!
Yeah I already use fastapi background tasks because as you said, it supports async and it's already included. That's very cool.
But I think that it has some limitations, meaning you may need to spawn multiple instances of your FastAPI app to handle these tasks to avoid slowing down your API too much.

Also, if for some reason your app crashes or reboots, you loose all the tasks which is not ideal.

I heard about dramatiq, never tried it though. I thought Celery was supposed to support async, but it seems to have been delayed. I'll see what I can find.

from fastapi-template.

s3rius avatar s3rius commented on May 17, 2024 1

@haffi96 RQ supports only redis. Also taskiq can pipeline tasks using taskiq-pipelines library and it's easily extendable.

from fastapi-template.

s3rius avatar s3rius commented on May 17, 2024 1

@haffi96 Added a tag. Thanks for noticing.

from fastapi-template.

s3rius avatar s3rius commented on May 17, 2024

Hi. You have several ways of doing this. Have you tried default fastapi background tasks? https://fastapi.tiangolo.com/tutorial/background-tasks/

Celery and Dramatiq are nice , but these libraries don't support async functions (You can overpass this restriction using async_to_sync function from asgiref) .

Often I write workers by hand. by creating python file that listens to specific queue.

from fastapi-template.

haffi96 avatar haffi96 commented on May 17, 2024

Whats the benefit/differences of taskiq compared to rq? https://python-rq.org/ or perhaps https://github.com/samuelcolvin/arq if you want built in async

from fastapi-template.

Related Issues (20)

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.