Skip to content

Commit

Permalink
scripting, web: don't join threads, sleep a hundred billion years
Browse files Browse the repository at this point in the history
  • Loading branch information
vindarel committed Sep 19, 2024
1 parent 419bb40 commit 1652029
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions scripting.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,14 @@ can do something like this:

~~~lisp
(defun main ()
(start-app :port 9003) ;; our start-app, for example clack:clack-up
;; let the webserver run.
;; warning: hardcoded "hunchentoot".
;; You can simply run (sleep most-positive-fixnum)
(handler-case (bt:join-thread (find-if (lambda (th)
(search "hunchentoot" (bt:thread-name th)))
(bt:all-threads)))
(handler-case
(progn
(start-app :port 9003) ;; our start-app, for example clack:clack-up
;; let the webserver run,
;; keep the server thread in the foreground:
;; sleep for ± a hundred billion years.
(sleep most-positive-fixnum))
;; Catch a user's C-c
(#+sbcl sb-sys:interactive-interrupt
#+ccl ccl:interrupt-signal-condition
Expand Down

0 comments on commit 1652029

Please sign in to comment.