fix actor flow: ac-loop, send

This commit is contained in:
Helmut Merz 2025-06-16 14:40:00 +02:00
parent dfb6ca23c9
commit 17899b934c

View file

@ -83,11 +83,11 @@
(if ok
(if (eq (content msg) +quit-message+)
(progn (async:set-status tsk :stopped) nil)
(let ((*self* tsk))
(progn
(async:set-status tsk :running)
;(ac-loop tsk (or (funcall bhv msg) bhv))
(funcall bhv msg)
(ac-loop tsk (async:behavior tsk))))
(let ((*self* tsk))
(funcall bhv msg)
(ac-loop tsk (async:behavior tsk)))))
(progn (async:set-status tsk :suspended) bhv))))
(defmethod send ((tsk async:restartable-task) msg)
@ -97,7 +97,7 @@
(async:set-status tsk :stopped)
(return-from send))
(async:snd tsk msg)
(when (or (eq status :new) (eq status :suspended))
(unless (eq status :running)
(async:try-receive-result tsk)
(async:submit-task
tsk (lambda () (ac-loop tsk (async:behavior tsk)))))