]> git.pond.sub.org Git - eow/blob - Notes
Add a game state log dumping facility that produces a (load)able sexpr-log.
[eow] / Notes
1
2 reproducible install
3  - dependencies
4  - install from clean state
5
6 use sb-concurrency mailbox instead of own
7
8 --------------------------------------------------------------------------------
9 On COMET w/ hunchentoot: http://common-lisp.net/pipermail/tbnl-devel/2009-February/004620.html
10
11 I have a working comet system using Hunchentoot.
12
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.
16
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
20 available.
21
22 (defun kill-comet-thread (thread)
23   (warn "KILLING COMET THREAD: ~a" thread)
24   (ignore-errors
25     (destroy-thread thread)))
26
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)))
33
34 (defun comet (fn &optional (session *working-session*))
35   (setf (session-value 'comet-fn session) fn)
36   (signal-semaphore (session-value 'comet-semaphore session)))
37
38 --------------------------------------------------------------------------------
39
40 Empire connection handling
41
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.
46
47 Using the object system like I do it right doesn't seem like a really good fit.