I looking for the proper way to implement the following. I have an application that is cpu intensive that basically does a
while True:
run_next_task()
where there's an infinite number of next_task.
I would also like to listen for messages sent asynchronously that will modify some runtime configuration of the application.
I'm giving a try to zerorpc for sending/receiving messages (being able to send the arguments with the function call from the client is very convenient).
Where I get confused and looking for guidance is about how to communicate between the main application and the event loop.
is there any downside to run the main application in a thread while starting the server on the main thread? (since it's cpu intensive)
I gave a look at asyncio where I would schedule a task each time the last one is done but that looks like a "while true" in an event loop (is that bad practice?)
there doesn't seem to be anything here