Home Website Changes Log in Log out

Continuation Server

Serves continuations.

In traditional web applications the server is in control of your application. When the web server gets a new request, it starts a new instance of your program and demands that it immediately process the request. When the program is complete, providing output back to the web server, it completely exits. Details on this may vary, but the theme is the same -- your program runs when the web server tells it to run and exits afterward.

Using a continuation server inverts this flow. Your program runs, and when it is ready it asks the webserver to give it the next available request. The program then processes this request and gives back output, but then does not exit. Instead it continues until it requests more input from the webserver. Your program is in control instead of the server.

So far what I describe is the equivalent of having an embedded webserver in your application that only serves a single browser. Using continuations to invert this control structure has another advantage. Continuations provide a simple cooperative multitasking system. It's like threads, except without all the strings attached.