Chat freely about anything...

User avatar
By ob2s
#87077 I have a URL that results in a task that runs 30 seconds. I'd like to accept the connection and start the 30 second operation and immediately return the response, thus releasing the http connection. Then if a different URL comes in, it would kill the 30 second loop if it is still running and then do its 1 second task. Is this possible ? I know the esp8266 is not a linux box, but I thought I would ask.
Thanks
User avatar
By EmmaDelgado
#87108 Python (and hence MicroPython) doesn't work like that. The REPL only appears when a user program terminates. There is no way to run a user program in the background.

A (u)asyncio application supports multiple coroutines with execution passing between them at defined points in each coroutine's code. But, like other applications, the REPL won't appear until the program terminates.