Closed dhruv-kabariya closed 2 years ago
Hi @dhruv-kabariya
Yes, It's correct.
The function opens a separate process with a countdown and terminates the process after the countdown.
The Stream stays in memory and no matter how many calls you make on the index "/", it will only be consumed once.
@mpimentel04 Thank you for the quick replay. It solves my doubt.
@app.get("/keep-alive") def keep_alive(): global manager global count_keep_alive count_keep_alive = 100 if not manager: manager = Queue() p = Process(target=start_stream, args=(url_rtsp, manager,)) p.start() threading.Thread(target=manager_keep_alive, args=(p,)).start()
here we see that it start new thread for request. is this right ?