Reputation: 339
I want to write an API method that will do a specific task (e.g task/create) But this task takes a long time. I want the user to run the task (task/create) and then polled the service until it was executed (task/status). As soon as the task is completed, the user can request the result (e.g task/result). What tools can I use to implement such a pattern? Can I put the task on a separate thread?
Upvotes: 0
Views: 286
Reputation: 438
Yes, you can put the task on a separate thread.
See Celery for Django Tutorial
Once you setup your celery you can call different tasks on separate threads to complete the task. Also, you can put a scheduled, periodical tasks as well.
Upvotes: 2