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
|
||||
|
||||
(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))))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue