Artem Bernatskyi
Artem Bernatskyi

Reputation: 4687

getting result in short running celery task (Django)

What is the best way to implement getting result in short running celery task (3-7 seconds) ?

For now i use this method below.

UPDATE: question should be closed at it has no difference between getting result from long running task .

Upvotes: 0

Views: 217

Answers (1)

cwallenpoole
cwallenpoole

Reputation: 82078

As a general rule (with all background tasks, not just Celery/Django) that's actually your best bet. The same pattern emerges

  • User makes HTTP request
  • Server kicks off background service (either through Celergy, some other async. service, or even through a command line execution (<- don't do that if you can avoid it)) and returns some form of identifier
  • User agent makes new HTTP request to get information about state of new service/process.

You should check out long polling

Upvotes: 1

Related Questions