Doing a task after serving a page

David Johnson-Davies <[email protected]> Wed, 18 Jun 2003 17:58:23 +0100
Newsgroups gmane.lisp.cl-http
Message-ID <BB1658BF.1211C%[email protected]>
Can anyone help with this query? I'm trying to do a time-consuming task
after serving a page, and tried:

(defmethod write-test-page ((url url:http-url) stream)
    (with-conditional-get-response (stream :html)
        (with-html-document (:stream stream)
            (with-standard-document-body (:stream stream)
                (write-string "Test page" stream))))
    (time-consuming-task))

(export-url #u"/test.html"
            :computed
            :response-function #'write-test-page)

However, the user's browser seems to wait until (time-consuming-task) is
completed before receiving the page. I thought putting it outside the
(with-conditional-get-response ...) procedure would ensure that the page
gets served first.

Have I misunderstood something, and is there a solution to this?

Thanks,
David Johnson-Davies

+------------------------------------------------------------+
David Johnson-Davies, Human-Computer Interface Ltd
17 Signet Court, Swanns Road, Cambridge, CB5 8LA, England.

Tel: +44 1223 314934, Fax: +44 1223 462562
Email: [email protected], Web: http://www.interface.co.uk/
+------------------------------------------------------------+