I'm doing monitoring work with django. The program required to have a looping-forever sitting in background to process receiving data and update to database.
The job could be worked by writing a python script, and run in background with, for example, supervisord. However, I prefer the solution with django itself; that's the server process stay in a loop, listening for incoming packet.
Any suggestion would be high value and appreciate. Many thanks in advance.
In case you feel that Celery is a bit oversized for your needs you could also define a custom management command that lives forever and waits for your incoming packet.
I suggest you to use Celery which works with Django and has support for long running tasks among other features.
http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html
http://docs.celeryproject.org/en/latest/getting-started/introduction.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With