[net-nittin-irc-cvs] CVS update: net-nittin-irc/package.lisp net-nittin-irc/protocol.lisp
Kevin Rosenberg
krosenberg at common-lisp.net
Thu Dec 18 19:28:31 UTC 2003
Update of /project/net-nittin-irc/cvsroot/net-nittin-irc
In directory common-lisp.net:/tmp/cvs-serv8388
Modified Files:
package.lisp protocol.lisp
Log Message:
add stop-background-message-handler function
Date: Thu Dec 18 14:28:30 2003
Author: krosenberg
Index: net-nittin-irc/package.lisp
diff -u net-nittin-irc/package.lisp:1.15 net-nittin-irc/package.lisp:1.16
--- net-nittin-irc/package.lisp:1.15 Tue Dec 16 18:27:25 2003
+++ net-nittin-irc/package.lisp Thu Dec 18 14:28:28 2003
@@ -1,4 +1,4 @@
-;;;; $Id: package.lisp,v 1.15 2003/12/16 23:27:25 krosenberg Exp $
+;;;; $Id: package.lisp,v 1.16 2003/12/18 19:28:28 krosenberg Exp $
;;;; $Source: /project/net-nittin-irc/cvsroot/net-nittin-irc/package.lisp,v $
;;;; See the LICENSE file for licensing information.
@@ -13,6 +13,7 @@
(:export :read-message-loop
:read-message
:start-background-message-handler
+ :stop-background-message-handler
:send-message
:server-name
:no-such-reply
Index: net-nittin-irc/protocol.lisp
diff -u net-nittin-irc/protocol.lisp:1.30 net-nittin-irc/protocol.lisp:1.31
--- net-nittin-irc/protocol.lisp:1.30 Tue Dec 16 18:32:26 2003
+++ net-nittin-irc/protocol.lisp Thu Dec 18 14:28:29 2003
@@ -1,4 +1,4 @@
-;;;; $Id: protocol.lisp,v 1.30 2003/12/16 23:32:26 krosenberg Exp $
+;;;; $Id: protocol.lisp,v 1.31 2003/12/18 19:28:29 krosenberg Exp $
;;;; $Source: /project/net-nittin-irc/cvsroot/net-nittin-irc/protocol.lisp,v $
;;;; See LICENSE for licensing information.
@@ -123,7 +123,7 @@
(defvar *process-count* 0)
(defmethod start-background-message-handler ((connection connection))
"Read messages from the `connection', parse them and dispatch
-irc-message-event on them."
+irc-message-event on them. Returns background process ID if available."
(flet ((do-loop () (read-message-loop connection)))
(let ((name (format nil "irc-hander-~D" (incf *process-count*))))
#+allegro (mp:process-run-function name #'do-loop)
@@ -136,6 +136,13 @@
:input (lambda (fd)
(declare (ignore fd))
(read-message connection))))))
+
+(defun stop-backgound-message-handler (process)
+ "Stops a background message handler process returned by the start function."
+ #+cmu (mp:destroy-process process)
+ #+allegro (mp:process-kill process)
+ #+sb-thread (sb-thread:destroy-thread process)
+ #+lispworks (mp:process-kill process))
(defmethod read-message-loop ((connection connection))
(loop while (read-message connection)))
More information about the Net-nittin-irc-cvs
mailing list