AppOfflineError if the browser is busy with long running functions

Adding sleep(0) gives me the control over what happens when.

Unleashing the equivalent at random times could introduce weird behaviors difficult to trace and debug.

It reminds me of threads vs async. We are in an async world, we don’t want to convert it to a threads world and risk to break all kinds of apps.

Perhaps you should “unblock the thread every so often” only to make the server calls happy, and give the control back to the long running task when they are completed?

Then, when the long running task ends, the the event loop will keep doing its job and the line that follows the server call will be executed.

2 Likes