SVN: ZODB/trunk/src/ZEO/zrpc/connection.py Gave delay objects a repr for debugging purposes.

Jim Fulton <[email protected]>
Newsgroups gmane.comp.python.zope.zodb.cvs
Message-ID <[email protected]>
Log message for revision 111922:
  Gave delay objects a repr for debugging purposes.
  

Changed:
  U   ZODB/trunk/src/ZEO/zrpc/connection.py

-=-
Modified: ZODB/trunk/src/ZEO/zrpc/connection.py
===================================================================
--- ZODB/trunk/src/ZEO/zrpc/connection.py	2010-05-04 14:21:47 UTC (rev 111921)
+++ ZODB/trunk/src/ZEO/zrpc/connection.py	2010-05-04 14:41:32 UTC (rev 111922)
@@ -44,17 +44,25 @@
     the mainloop from sending a response.
     """
 
+    msgid = conn = sent = None
+
     def set_sender(self, msgid, conn):
         self.msgid = msgid
         self.conn = conn
 
     def reply(self, obj):
+        self.sent = 'reply'
         self.conn.send_reply(self.msgid, obj)
 
     def error(self, exc_info):
+        self.sent = 'error'
         log("Error raised in delayed method", logging.ERROR, exc_info=True)
         self.conn.return_error(self.msgid, *exc_info[:2])
 
+    def __repr__(self):
+        return "%s[%s, %r, %r, %r]" % (
+            self.__class__.__name__, id(self), self.msgid, self.conn, self.sent)
+
 class Result(Delay):
 
     def __init__(self, *args):
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.