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