[<<][sweb][>>][..]
Tue Aug 19 11:22:25 CEST 2008

continuations

Ok, it seems quite straightforward.  Leaving the continuation
management at the default, here's an example:

#lang scheme/base
;; -*- scheme -*-
(require
 scheme/pretty
 web-server/servlet
 web-server/servlet/web)

;; plt servlet interface
(provide interface-version timeout start)
(define interface-version 'v1)
(define timeout +inf.0)

(define (start req)
  (for ((i (in-naturals)))
    (send/suspend (page i))))

(define ((page i) url)
  (printf "~a\n" url)
  `(xhtml ()
          ,(format "Page ~a. " i)
          (a ((href ,url)) "[next]")))


So, when to use continuations, and when to use objects?  I.e. a
shopping cart is an object: it should collect items from different
parallel threads.



[Reply][About]
[<<][sweb][>>][..]