Question

I am creating django applications(applications in django terminology) where 1st application inserts data in a table and 2nd application picks one item from table, processes it and finally remove from table. It continues to do so until all entries are processed. When all entries are processed it stops. It start again when a new entry is made. So it is like consumer-producer problem.

How can I use django signals to start 2nd application when a first entry is made into the table?

Was it helpful?

Solution

Solution to the problem is django-celery as mentioned in the comment. django-celery provides a task queue and process tasks without blocking request. So while inserting a new item if producer finds table empty, it signals to consumer with post_save method and handler start the task and stops when all finished.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top