On Dec 28, 9:29 am, James Douglas <
jamesdoug...@gmail.com> wrote:
> > Is there a role for continuations in the request-response cycle?
>
> I think so. Especially in situations where you have some known
> workflow to process with multiple request/response cycles. Consider
> the check-out process on an online shopping website, which requires
> you to submit identifying information, then payment information,
> approve your own order, and receive an invoice/summary. Each of these
> depends on your state in the overall workflow, and can lead to some
> nasty logic to determine what this is.
>
> One way delimited continuations can be used to approach this is to
> allow the workflow to be written in an imperative style, and
> transparently convert each step in the workflow to a request/response
> cycle. I wrote an example of this here:
http://www.earldouglas.com/continuation-based-web-workflows-part-two/
>
> There's also a role for continuations on the server-side (e.g. Jetty
> Continuations or Servlet 3 suspendable requests) to prevent
> unnecessary blocking of your Web endpoints. Here's a little example: