From 1652029917d26127efe1560ffb710807eabcc0b8 Mon Sep 17 00:00:00 2001 From: vindarel Date: Thu, 19 Sep 2024 15:00:40 +0200 Subject: [PATCH] scripting, web: don't join threads, sleep a hundred billion years --- scripting.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripting.md b/scripting.md index a5f20a2..8cd9694 100644 --- a/scripting.md +++ b/scripting.md @@ -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