Hi ,
in my project, I want to use Django and Web sockets. The Solution is --> Channels.
But I have a problem. How can I start and stop an external long running thread from inside Django. I don't want to start an separate worker via console. I want to start it inside Django (Maybe in Consumer.py)
Concept:
1. The thread should be started, when a message is received via web socket.
2. In the thread I stream data to the sender of the websocket message until I get a stop message via web socket from that sender.
How can I realize that? In Channels are Background Worker available. But I am not sure if it is the right mechanism for me? Maybe Django is not the right tool for my problem?