by jrochkind1 · 7y ago · 0 comments
That seems like a bad architecture for a web app.
A long time ago I wrote web apps in WebObjects (originally NeXT, then Apple). While it didn't use continuations, it did rely on maintaining server state for every client, in order to try to make writing a web app transparently as much like writing a 'native' (we didn't call them native then) app as possible. That aspect of architecture -- persistent client-specific state on the server meant to be tracking what the client was doing -- was a fundamental mismatch for the web, and led to lots of complexity and problems. While it seems like it can/should be transparent/automatic (and that was the intent of the WebObjects archiecture), it ends up an abstraction with significant leaks, just because it's such a poor match for the mostly stateless web client-server architecture.
One trouble with that kind of system is each session requires a lot of memory so you have to implement a timeout and no matter how long you make the timeout, users are going to be mad if they got through 15 pages of forms, had to wait on hold on the phone to get the information for page 16 and then they lost it. People expect to be able to walk away from Microsoft Word on Friday and still be able to use it on Monday, etc.
Continuations are much more memory efficient but still have challenges. I am having a lot of fun with python asyncio, but you can't pickle tasks out of the box so you can't migrate tasks between servers on a cluster, reload them after a crash, flush them out of memory if memory is tight, etc.