Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress bar #453

Closed
lovasko opened this issue Aug 27, 2015 · 4 comments
Closed

Progress bar #453

lovasko opened this issue Aug 27, 2015 · 4 comments

Comments

@lovasko
Copy link

lovasko commented Aug 27, 2015

The method celery.app.task.update_state supports metadata to be handed over. Is there any plan on supporting the state name "PROGRESS" and the metadata dictionary to render a progress bar of a task based on some agreed dictionary structure?

@schaubl
Copy link

schaubl commented Oct 7, 2015

👍 This would be very useful.

I had a quick look into the code to see how to implement that and what I understood is that Flower is only receiving events but there is no event sent in the state PROGRESS or any custom state.
So the only way to do this will be to periodically consume messages from the result backend.

Am I right ?

@schaubl
Copy link

schaubl commented Oct 7, 2015

I just discovered the issue #143 which answered my question.

@mher
Copy link
Owner

mher commented Mar 5, 2016

task-custom event is added to the event list #478

@mher mher closed this as completed Mar 5, 2016
@EugZol
Copy link

EugZol commented Feb 7, 2021

Is there a complete working example somewhere?

I tried the following:

@shared_task(bind=True)
def test_task(self):
    from time import sleep

    for i in range(1, 101):
        sleep(1)
        self.send_event('task-progress', current=i, total=100)

This leads to state 'PROGRESS' being displayed in Flower, but no current/total is seen anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants