GithubHelp home page GithubHelp logo

Comments (4)

miguelgrinberg avatar miguelgrinberg commented on May 27, 2024

Not sure Socket.IO is really necessary in your case. How much data will need to be transferred between the server doing the heavy computations and the client? And how often?

If the amount of data necessary for the client to display updates is small, then maybe you should consider using regular HTTP polling as a first implementation, and only move to Socket.IO later if you find that you need that.

I have written an article regarding the use of Flask with Celery, which I think may fit your situation. The article is here: http://blog.miguelgrinberg.com/post/using-celery-with-flask. In one of the examples I present, a long running task sends progress updates to the client, which displays a progress bar.

from flask-socketio-chat.

jithurjacob avatar jithurjacob commented on May 27, 2024

Wow this is exactly what I'm looking for. Thank you

from flask-socketio-chat.

irfanmaroof avatar irfanmaroof commented on May 27, 2024

@miguelgrinberg Your post make sense but why SocketIO is not best solution for this use case ?
I need something similar in my application but i don't want to try celery because it would be something really new for my application and don't want to introduce just for for progress bar.
Do you have an example with socketIO for long running backend task and realtime progress bar on frontend.

from flask-socketio-chat.

miguelgrinberg avatar miguelgrinberg commented on May 27, 2024

@irfanmaroof Celery is not used for the progress bar, it is used for the heavy computational task. As a side effect of having a long task running as a Celery job, you can provide progress updates, but the point of Celery is to run the heavy task.

Unfortunately if you need to do heavy computation you cannot do it within the context of an asynchronous server, so as much as you don't want to introduce a new component, for this type of problem it is usually needed.

from flask-socketio-chat.

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.