Django and Background Tasks

24 views
Skip to first unread message

matrix1900

unread,
Oct 17, 2017, 10:18:05 AM10/17/17
to Django users
Hi,

I want to use a Data Collector Process to receive data from a separate Source (Sensor Data, etc)  and deliver new values via websocket to a client (Website). 
Steps to do:
1. User opens website :  page 01,
2. Django receives a web socket message: page01 from the user (routing, consumers.py)
3. Django starts the Data Collector Process with transfer parameter "page01"
4. The Data Collector Process calls permanent  the required values from the source  and when new values available send it vie websocket to the specific user. (Update new values)
4. When the user leaves the website, django has to exit the Data Collector Process.


So the website has more sites. Each of them consists a view for different data sources from the Data Collector Process.
I read many about Celery and Background Process. But the information is to less for, me to Solve my Problems. In Celery I am not able to start a separate process from django and finish after a user leaves the website.  Or can somebody makes a good example for me?
Reply all
Reply to author
Forward
0 new messages