From 4503391b228b2679b6cc4b0231131f87f3040f4f Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Mon, 16 Jun 2025 22:51:50 +0200 Subject: [PATCH] actor: restartable task: remove explicit start, add error handling --- core/actor.lisp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/actor.lisp b/core/actor.lisp index 6ff2809..1f5556c 100644 --- a/core/actor.lisp +++ b/core/actor.lisp @@ -62,9 +62,7 @@ ;;;; the core (classical, i.e. Hewitt) actor API (defun create (bhv) - (let ((tsk (async:make-task bhv :restartable t))) - (start tsk bhv) - tsk)) + (async:make-task bhv :restartable t)) (defgeneric send (tsk msg) (:method ((tsk async:mailbox) msg) @@ -84,7 +82,8 @@ (progn (async:set-status tsk :running) (let ((*self* tsk)) - (funcall bhv msg) + (handler-case (funcall bhv msg) + (error (error) (util:lg :error "handling message" msg error))) (ac-loop tsk (async:behavior tsk))))) (async:set-status tsk :suspended))))