diff --git a/core/actor.lisp b/core/actor.lisp index fdf98dd..90b7acb 100644 --- a/core/actor.lisp +++ b/core/actor.lisp @@ -62,7 +62,7 @@ ;;;; the core (classical, i.e. Hewitt) actor API (defun create (bhv) - (let ((tsk (async:make-task bhv))) + (let ((tsk (async:make-task bhv :restartable t))) (start tsk bhv) tsk)) @@ -99,7 +99,7 @@ (async:try-receive-result tsk) (async:submit-task tsk (lambda () (ac-loop tsk (async:behavior tsk))))) - (async:set-status :running))) + (async:set-status tsk :running))) (defmethod set-bhv ((tsk async:task) bhv) (setf (async:behavior tsk) bhv)) @@ -120,7 +120,7 @@ (lambda (msg) ;(format t "calc ~a ~a~%" val (content msg)) (destructuring-bind (fn &optional param) (content msg) - (become (funcall fn msg val param))))) + (funcall fn msg val param)))) (defun plus (msg val param) (calculator (+ val param))) diff --git a/util/async.lisp b/util/async.lisp index 724b750..c163744 100644 --- a/util/async.lisp +++ b/util/async.lisp @@ -55,7 +55,7 @@ (defclass restartable-task (task) ((status :reader status - :initform (lp:make-channel :fixed-capacity 1 :initial-contents '(:new))))) + :initform (lpq:make-queue :fixed-capacity 1 :initial-contents '(:new))))) (defun make-task (bhv &key restartable (cls 'task)) (if restartable (setf cls 'restartable-task))