]> git.pond.sub.org Git - eow/blobdiff - web.lisp
Forward prompt to browser
[eow] / web.lisp
index 40b74066ca506a21ff2c3e9fe1617c6bdf8e9ae8..20e27510d2a67c37764967dd29b271b141479ee6 100644 (file)
--- a/web.lisp
+++ b/web.lisp
   "Send stream of updates to client"
   (locked-queue:dequeue *update-queue*))
 
+(defun send (string)
+  "Push a javascript update fragment to the client."
+  (locked-queue:enqueue *update-queue* string))
+
+(defun prompt (minutes btus)
+  (send (format nil "prompt(~a,~a);~%" minutes btus)))
+
 (defun dispatch (request)
   (let ((script-name (script-name request)))
     (cond