I wrote a application with the following logic:
1) Fetch Data with API2) Preprocess the Data3) Start topic modeling4) Create report and include data5) Handle final pdf report (send, show in browser ...)
Now i only want to start this 5 steps when a new response is received.
So far the script works, but only processes the response when i manually run the script on my system.
I also tried using pm2 for running the script like a daemon thread. However, even the script (process) runs forever, it loops over the 5 steps over and over again for the same response. But i want to stop the 5 steps after every individual response.
My desired architecture should look like that:
if new response: 1) Fetch Data with API 2) Preprocess the Data 3) Start topic modeling 4) Create report and include data 5) Handle final pdf report (send, show in browser ...)else: wait for new reponse …
Any help is appreciated.
EDIT in title* form not form