[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Document pinging and related code; clean some interface...



Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.mit.edu:/tmp/cvs-serv7890/lib/mixminion

Modified Files:
	ThreadUtils.py 
Log Message:
Document pinging and related code; clean some interfaces up slightly.

Index: ThreadUtils.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ThreadUtils.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- ThreadUtils.py	13 Dec 2004 01:06:43 -0000	1.8
+++ ThreadUtils.py	27 Dec 2004 00:15:57 -0000	1.9
@@ -299,8 +299,19 @@
                           self.threadName)
 
 class BackgroundingDecorator:
-    """DOCDOC"""
+    """Wraps an underlying object, and makes all method calls to the wrapped
+       object happen in a processing thread.
+
+       Return values from wrapped methods are lost.
+
+       Methods and attributes starting with _ are not wrapped;
+       otherwise, attribute access is not available.
+    """
+    #FFFF We could retain return values by adding some kind of a thunk
+    #FFFF system, or some kind of callback system.  But neither is needed
+    #FFFF right now.
     class _AddJob:
+        "Helper: A wrapped function for the underlying object."
         def __init__(self, processingThread, fn):
             self.thread = processingThread
             self.fn = fn
@@ -310,6 +321,8 @@
             self.thread.addJob(callback)
 
     def __init__(self, processingThread, obj):
+        """Create a new BackgroundingDecorator to redirect calls to the
+           methods of obj to processingThread."""
         self._thread = processingThread
         self._baseObject = obj