| 1 |
|
| 2 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 3 |
;; Test Example |
| 4 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 5 |
|
| 6 |
(require 'serve-event) |
| 7 |
|
| 8 |
(defun test-stdin (&aux exit) |
| 9 |
(format t "DOING STDIN. Type Q to exit.~%") |
| 10 |
(serve-event:with-fd-handler |
| 11 |
(0 :input #'(lambda (fd) |
| 12 |
(declare (ignore fd)) |
| 13 |
(let ((ch (read-char))) |
| 14 |
(format t "Got data ~s~%" ch) |
| 15 |
(when (char= ch #\Q) |
| 16 |
(setf exit t))))) |
| 17 |
(loop until exit |
| 18 |
do (format t "Entering serve-all-events...~%") |
| 19 |
(force-output) |
| 20 |
(serve-event:serve-all-events 5) |
| 21 |
(format t "Events served~%")))) |
| 22 |
|
| 23 |
(test-stdin) |