provide message methods (content, customer): anything may be a message
This commit is contained in:
parent
1b4ad4c9c4
commit
e0877cc20f
1 changed files with 7 additions and 1 deletions
|
@ -18,6 +18,12 @@
|
||||||
|
|
||||||
;;;; basic message implementation
|
;;;; basic message implementation
|
||||||
|
|
||||||
|
(defgeneric content (msg)
|
||||||
|
(:method (msg) msg))
|
||||||
|
|
||||||
|
(defgeneric customer (msg)
|
||||||
|
(:method (msg) nil))
|
||||||
|
|
||||||
(defclass message ()
|
(defclass message ()
|
||||||
((content :reader content :initarg :content :initform nil)
|
((content :reader content :initarg :content :initform nil)
|
||||||
(customer :reader customer :initarg :customer :initform nil)))
|
(customer :reader customer :initarg :customer :initform nil)))
|
||||||
|
@ -39,7 +45,7 @@
|
||||||
ch)))
|
ch)))
|
||||||
|
|
||||||
(defun stop (mb)
|
(defun stop (mb)
|
||||||
(send mb (message +quit-message+)))
|
(send mb +quit-message+))
|
||||||
|
|
||||||
(defun ac-loop (mb bhv)
|
(defun ac-loop (mb bhv)
|
||||||
(let ((msg (async:rcv mb)))
|
(let ((msg (async:rcv mb)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue