[Zodb-checkins] CVS: ZODB3/ThreadedAsync - LoopCallback.py:1.8.36.1 __init__.py:1.6.20.1

Jeremy Hylton jeremy at zope.com
Fri Jul 11 16:12:31 EDT 2003


Update of /cvs-repository/ZODB3/ThreadedAsync
In directory cvs.zope.org:/tmp/cvs-serv14554/ThreadedAsync

Modified Files:
      Tag: zodb33-devel-branch
	LoopCallback.py __init__.py 
Log Message:
Add function to remove a callback.


=== ZODB3/ThreadedAsync/LoopCallback.py 1.8 => 1.8.36.1 ===
--- ZODB3/ThreadedAsync/LoopCallback.py:1.8	Thu Dec 12 16:15:42 2002
+++ ZODB3/ThreadedAsync/LoopCallback.py	Fri Jul 11 15:12:23 2003
@@ -37,6 +37,16 @@
 _looping = None
 _loop_callbacks = []
 
+def remove_loop_callback(callback):
+    """Remove a callback function registered earlier.
+
+    This is useful if loop() was never called.
+    """
+    for i in range(len(_loop_callbacks)):
+        if _loop_callbacks[i][0] == callback:
+            del _loop_callbacks[i]
+            return
+
 def register_loop_callback(callback, args=(), kw=None):
     """Register callback function to be called when mainloop starts
 


=== ZODB3/ThreadedAsync/__init__.py 1.6 => 1.6.20.1 ===
--- ZODB3/ThreadedAsync/__init__.py:1.6	Tue Feb 25 10:17:09 2003
+++ ZODB3/ThreadedAsync/__init__.py	Fri Jul 11 15:12:23 2003
@@ -16,4 +16,4 @@
 $Id$
 """
 
-from LoopCallback import register_loop_callback, loop
+from LoopCallback import register_loop_callback, remove_loop_callback, loop




More information about the Zodb-checkins mailing list