logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Doing a task after serving a page: msg#00004

Subject: Doing a task after serving a page
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: david@xxxxxxxxxxxxxxx, Web: http://www.interface.co.uk/
+------------------------------------------------------------+





<Prev in Thread] Current Thread [Next in Thread>