mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 10:40:45 -08:00
Docs and clean up.
This commit is contained in:
parent
fc7c764d2d
commit
252f2bd922
4 changed files with 74 additions and 28 deletions
|
|
@ -1,31 +1,30 @@
|
|||
(defpackage #:test-clog
|
||||
(:use #:cl)
|
||||
(:export test-connect on-connect1 on-connect2))
|
||||
(:export test-connect on-connect))
|
||||
|
||||
(in-package :test-clog)
|
||||
|
||||
(defun on-connect1 (id)
|
||||
(defun on-connect (id)
|
||||
(format t "Connection ~A is valid? ~A~%" id (clog-connection:validp id))
|
||||
;; (clog:execute-script id "alert('test1');")
|
||||
(dotimes (n 10)
|
||||
(clog-connection:cwrite id "<b>connection-write</b>")
|
||||
(clog-connection:cwriteln id "<i>connection-writeln</i>")
|
||||
(sleep .2))
|
||||
(clog-connection:cwrite id "<br><b>Query Result : </b>")
|
||||
(clog-connection:cwrite id (clog-connection:query id "navigator.appVersion"))
|
||||
(clog-connection:cwrite id "<hr>simulate network interupt")
|
||||
(clog-connection:cclose id)
|
||||
(sleep .2)
|
||||
(clog-connection:cwrite id "<br><b>reconnected</b>")
|
||||
(sleep .2)
|
||||
(clog-connection:cwrite id "<br><b>shutting down connection</b>")
|
||||
(sleep .2)
|
||||
;; It is generally uneccessary to shutdown the connection
|
||||
(clog-connection:shutdown id))
|
||||
|
||||
(defun on-connect2 (id)
|
||||
(clog-connection:cwrite id "<b>Query Result : </b>")
|
||||
(clog-connection:cwrite id (clog-connection:query id "navigator.appVersion")))
|
||||
|
||||
(defun test-connect ()
|
||||
(print "Init connection")
|
||||
(clog:initialize #'on-connect2 :boot-file "/debug.html")
|
||||
(clog:initialize #'on-connect :boot-file "/debug.html")
|
||||
(print "Open browser")
|
||||
(clog:open-browser)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue