actor: restartable task: remove explicit start, add error handling
This commit is contained in:
parent
f498b0cf78
commit
4503391b22
1 changed files with 3 additions and 4 deletions
|
@ -62,9 +62,7 @@
|
||||||
;;;; the core (classical, i.e. Hewitt) actor API
|
;;;; the core (classical, i.e. Hewitt) actor API
|
||||||
|
|
||||||
(defun create (bhv)
|
(defun create (bhv)
|
||||||
(let ((tsk (async:make-task bhv :restartable t)))
|
(async:make-task bhv :restartable t))
|
||||||
(start tsk bhv)
|
|
||||||
tsk))
|
|
||||||
|
|
||||||
(defgeneric send (tsk msg)
|
(defgeneric send (tsk msg)
|
||||||
(:method ((tsk async:mailbox) msg)
|
(:method ((tsk async:mailbox) msg)
|
||||||
|
@ -84,7 +82,8 @@
|
||||||
(progn
|
(progn
|
||||||
(async:set-status tsk :running)
|
(async:set-status tsk :running)
|
||||||
(let ((*self* tsk))
|
(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)))))
|
(ac-loop tsk (async:behavior tsk)))))
|
||||||
(async:set-status tsk :suspended))))
|
(async:set-status tsk :suspended))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue