diff --git a/core/actor.lisp b/core/actor.lisp index 9ba38ae..5f849ac 100644 --- a/core/actor.lisp +++ b/core/actor.lisp @@ -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)))))