app/demo: experimental: keep app running until ctrl-c/kill signal
This commit is contained in:
parent
ec880c3695
commit
7a838af162
4 changed files with 20 additions and 11 deletions
|
@ -13,12 +13,23 @@
|
|||
|
||||
(in-package :scopes/app/demo)
|
||||
|
||||
(defvar *quit-queue* (lparallel.queue:make-queue :fixed-capacity 1))
|
||||
|
||||
(defun main()
|
||||
;(setf (trivial-signal:signal-handler :int) #'quit-handler)
|
||||
;(setf (trivial-signal:signal-handler :term) #'quit-handler)
|
||||
(let ((config-path (util:relative-path "config" "etc")))
|
||||
(format t "~%Hello World.~%config-path: ~s~%" config-path)
|
||||
(load config-path))
|
||||
(core:setup-services)
|
||||
;(setf forge:*forge-env* (forge:forge-env))
|
||||
;(forge:setup-builtins)
|
||||
(forge:repl)
|
||||
(core:shutdown))
|
||||
(unwind-protect
|
||||
(progn
|
||||
(core:setup-services)
|
||||
;(setf forge:*forge-env* (forge:forge-env))
|
||||
;(forge:setup-builtins)
|
||||
;(forge:repl)
|
||||
(lparallel.queue:pop-queue *quit-queue*))
|
||||
(core:shutdown)))
|
||||
|
||||
(defun quit-handler (sig)
|
||||
(format t "~%quit-handler: got signal ~s~%" sig)
|
||||
(lparallel.queue:push-queue sig))
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
:version "0.0.1"
|
||||
:homepage "https://www.cyberconcepts.org"
|
||||
:description ""
|
||||
:depends-on (:scopes)
|
||||
:depends-on (:scopes :lparallel :trivial-signal)
|
||||
:components ((:file "main"))
|
||||
:build-operation "program-op"
|
||||
:build-pathname "bin/demo"
|
||||
|
|
|
@ -47,8 +47,7 @@
|
|||
(format nil
|
||||
"<a href=\"https://example.com\" title=\"Demo\" ~
|
||||
class=\"demo-link plain\">Link to example.com</a>"))
|
||||
(== (dom:render (dom:br nil))
|
||||
(format nil "<br>")))
|
||||
(== (dom:render (dom:br)) (format nil "<br>")))
|
||||
|
||||
(deftest test-jwt ()
|
||||
(let ((secret (crypt:create-secret))
|
||||
|
|
|
@ -49,8 +49,7 @@
|
|||
(defmethod put ((el element))
|
||||
(let ((tag (tagname el)))
|
||||
(start tag (attrs el))
|
||||
(dolist (c (body el))
|
||||
(put c))
|
||||
(put (body el))
|
||||
(end tag)))
|
||||
|
||||
(defun elem (tag &optional attrs body)
|
||||
|
@ -74,7 +73,7 @@
|
|||
(defmacro make-elements (tags &optional (elem-fn 'elem))
|
||||
`(progn
|
||||
,@(mapcar (lambda (tag) ;`(make-element ,tag)) tags)))
|
||||
`(defun ,tag (attrs &rest body)
|
||||
`(defun ,tag (&optional attrs &rest body)
|
||||
(funcall (function ,elem-fn) ',tag attrs body)))
|
||||
tags)))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue