work in progress: use new async task definition
This commit is contained in:
parent
2042748fc8
commit
eef43f090e
1 changed files with 8 additions and 7 deletions
|
@ -47,10 +47,11 @@
|
|||
(defun stop (mb)
|
||||
(send mb +quit-message+))
|
||||
|
||||
(defun ac-loop (mb bhv)
|
||||
(let ((msg (async:rcv mb)))
|
||||
(unless (eq (content msg) +quit-message+)
|
||||
(ac-loop mb (or (funcall bhv msg) bhv)))))
|
||||
(defgeneric ac-loop (tsk bhv)
|
||||
(:method ((tsk async:mailbox) bhv)
|
||||
(let ((msg (async:rcv tsk)))
|
||||
(unless (eq (content msg) +quit-message+)
|
||||
(ac-loop tsk (or (funcall bhv msg) bhv))))))
|
||||
|
||||
(defun ac-vloop (mb bhv)
|
||||
(multiple-value-bind (msg ok) (async:try-rcv mb)
|
||||
|
@ -64,9 +65,9 @@
|
|||
;;; there is no `become` operation: the behavior just returns the new behavior
|
||||
|
||||
(defun create (bhv)
|
||||
(let ((mb (async:make-mb)))
|
||||
(start mb bhv)
|
||||
mb))
|
||||
(let ((tsk (async:make-task bhv)))
|
||||
(start tsk bhv)
|
||||
tsk))
|
||||
|
||||
(defun send (mb msg)
|
||||
;(util:lgi msg)
|
||||
|
|
Loading…
Add table
Reference in a new issue