A few years ago I was using the tornado framework with python. It was really similar to Flow in that it tried to provide high performance on a single thread via asynchronous operations.
The problem with tornado is that it used an event loop to simulate concurrency. Functions could “yield” to the event loop when ever they we’re about to do something like I/O, which was akin to saying “ok, peempt me now and then come back to this spot in the function when the long running I/O is done. But in the mean time let someone else run their code while I’m waiting”.
The problem with this was always “what happens if I forget to yield”? Say I start doing some CPU intensive calculation and it takes me half a second to finish this calculation. During that time, I’ve grabbed the single thread of execution and no one else can make any progress.
I’m not sure if Flow uses an event loop model, but it must have to deal with this problem of long running tasks hogging the single thread of execution. Does Flow have some sort of task/green thread preemption built into it?