1 On COMET w/ hunchentoot: http://common-lisp.net/pipermail/tbnl-devel/2009-February/004620.html
3 I have a working comet system using Hunchentoot.
5 The basic way I'm operating is to have the browser contact the hunchentoot
6 server and the server thread waits on a semaphore. Any other thread can then
7 release the semaphore and cause a reply back to the browser.
9 Hope this helps. I am only using this for development purposes, as I have
10 been having problems with certain browsers, and this will also occupy one of
11 the available browser requests, where many browsers have a very small number
14 (defun kill-comet-thread (thread)
15 (warn "KILLING COMET THREAD: ~a" thread)
17 (destroy-thread thread)))
19 (defun handle-comet ()
20 (awhen (session-value 'comet-thread) (kill-comet-thread it))
21 (setf (session-value 'comet-thread) *current-thread*)
22 (wait-on-semaphore (session-value 'comet-semaphore))
23 (setf (session-value 'comet-thread) nil)
24 (aif (session-value 'comet-fn) (funcall it)))
26 (defun comet (fn &optional (session *working-session*))
27 (setf (session-value 'comet-fn session) fn)
28 (signal-semaphore (session-value 'comet-semaphore session)))