[racket] usage of plt-web-server command
Near the end of 3.9 Soft State section found on
http://docs.racket-lang.org/web-server/stateless.html?q=%23%3Aquit&q=rackunit&q=commandline&q=substring&q=dispatch-rules&q=response/full#(part._stateless-example)
#lang web-server
(provide interface-version start)
(define interface-version 'stateless)
(define softie
(soft-state
(printf "Doing a long computation...\n")
(sleep 1)))
(define (start req)
(soft-state-ref softie)
(printf "Done\n")
(start
(send/suspend
(lambda (k-url)
(response/xexpr
`(html (body (a ([href ,k-url]) "Done"))))))))
$ plt-web-server -p 8080
Doing a long computation...
Done
Done
Done
Done
How does the above command know that it's supposed to execute the code
above it? Is there some convention for this magic to happen?
jGc