4 - install from clean state
6 use sb-concurrency mailbox instead of own
8 --------------------------------------------------------------------------------
9 On COMET w/ hunchentoot: http://common-lisp.net/pipermail/tbnl-devel/2009-February/004620.html
11 I have a working comet system using Hunchentoot.
13 The basic way I'm operating is to have the browser contact the hunchentoot
14 server and the server thread waits on a semaphore. Any other thread can then
15 release the semaphore and cause a reply back to the browser.
17 Hope this helps. I am only using this for development purposes, as I have
18 been having problems with certain browsers, and this will also occupy one of
19 the available browser requests, where many browsers have a very small number
22 (defun kill-comet-thread (thread)
23 (warn "KILLING COMET THREAD: ~a" thread)
25 (destroy-thread thread)))
27 (defun handle-comet ()
28 (awhen (session-value 'comet-thread) (kill-comet-thread it))
29 (setf (session-value 'comet-thread) *current-thread*)
30 (wait-on-semaphore (session-value 'comet-semaphore))
31 (setf (session-value 'comet-thread) nil)
32 (aif (session-value 'comet-fn) (funcall it)))
34 (defun comet (fn &optional (session *working-session*))
35 (setf (session-value 'comet-fn session) fn)
36 (signal-semaphore (session-value 'comet-semaphore session)))
38 --------------------------------------------------------------------------------
40 Empire connection handling
42 Maybe do something like cl-irc does with register/unregister handler. Might be
43 even better combined with the modes system, provide an easy way to specify which
44 event types a specific mode implementation is interested in. Register automatically
45 on construction and deregister when leaving the mode.
47 Using the object system like I do it right doesn't seem like a really good fit.