I have a working comet system using Hunchentoot.

The basic way I'm operating is to have the browser contact the hunchentoot server and the server thread waits on a semaphore. Any other thread can then release the semaphore and cause a reply back to the browser.

Hope this helps. I am only using this for development purposes, as I have been having problems with certain browsers, and this will also occupy one of the available browser requests, where many browsers have a very small number available.

(defun kill-comet-thread (thread)
  (warn "KILLING COMET THREAD: ~a" thread)
  (ignore-errors
    (destroy-thread thread)))

(defun handle-comet ()
  (awhen (session-value 'comet-thread) (kill-comet-thread it))
  (setf (session-value 'comet-thread) *current-thread*)
  (wait-on-semaphore (session-value 'comet-semaphore))
  (setf (session-value 'comet-thread) nil)
  (aif (session-value 'comet-fn) (funcall it)))

(defun comet (fn &optional (session *working-session*))     
  (setf (session-value 'comet-fn session) fn)               
  (signal-semaphore (session-value 'comet-semaphore session)))



On Thu, Feb 26, 2009 at 4:01 PM, Jim Prewett <download@hpc.unm.edu> wrote:

Hello,

I'm not quite sure what I'm after except that the buzzword seems to be
"COMET".

AFAICT, much of the time, this involves having javascript send an
XMLHttpRequest to the server which the server keeps open until there is
data to be sent to the client.

Has anyone done anything like this?  Does anyone have thoughts on how one
might implement something along these lines?

All I am really after is some sort of "Server Push" - I'd be happy to hear
any thoughts anyone has along these lines.

Thanks,
Jim

James E. Prewett                    Jim@Prewett.org download@hpc.unm.edu
Systems Team Leader           LoGS: http://www.hpc.unm.edu/~download/LoGS/
Designated Security Officer         OpenPGP key: pub 1024D/31816D93
HPC Systems Engineer III   UNM HPC  505.277.8210

_______________________________________________
tbnl-devel site list
tbnl-devel@common-lisp.net
http://common-lisp.net/mailman/listinfo/tbnl-devel