work in progress: use util/async for core:service

This commit is contained in:
Helmut Merz 2025-03-06 14:07:33 +01:00
parent 4c5639a9b9
commit c6ec682937

View file

@ -2,7 +2,8 @@
(defpackage :scopes/core
(:use :common-lisp)
(:local-nicknames (:config :scopes/config)
(:local-nicknames (:async :scopes/util/async)
(:config :scopes/config)
(:message :scopes/core/message)
(:shape :scopes/shape)
(:util :scopes/util)
@ -73,7 +74,8 @@
(services :reader services :initform (make-hash-table))))
(defclass service (context)
((mailbox :reader mailbox :initform (lpq:make-queue))))
((task :accessor task :initform nil)
(mailbox :reader mailbox :initform (lpq:make-queue))))
(defgeneric do-start (ctx)
(:method ((ctx context)))
@ -100,6 +102,9 @@
(defun default-setup (cfg &optional (cls 'context) &rest args &key &allow-other-keys)
(apply #'make-instance cls :config cfg :name (config:name cfg) args))
;;; setup-service
;(setf (task child) (async:make-task :handle-message #'handle-message))
(defun find-service (name &optional (parent *root*))
(with-slots (services) parent
(when services