summary refs log tree commit diff
path: root/synapse/util/async.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-08-13 17:27:53 +0100
committerMark Haines <mark.haines@matrix.org>2015-08-13 17:27:53 +0100
commitc5966b2a97090bf5b1e2ced83e3f424a3f4d4cad (patch)
tree3cc3a75259e130906b963570e2c747f5ab0cba2d /synapse/util/async.py
parentAdd a few strategic new lines to break up the on_query_client_keys and on_cla... (diff)
parentMerge pull request #224 from matrix-org/erikj/reactor_metrics (diff)
downloadsynapse-c5966b2a97090bf5b1e2ced83e3f424a3f4d4cad.tar.xz
Merge remote-tracking branch 'origin/develop' into markjh/end-to-end-key-federation
Diffstat (limited to 'synapse/util/async.py')
-rw-r--r--synapse/util/async.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/synapse/util/async.py b/synapse/util/async.py
index 5a1d545c96..7bf2d38bb8 100644
--- a/synapse/util/async.py
+++ b/synapse/util/async.py
@@ -51,7 +51,7 @@ class ObservableDeferred(object):
         object.__setattr__(self, "_observers", set())
 
         def callback(r):
-            self._result = (True, r)
+            object.__setattr__(self, "_result", (True, r))
             while self._observers:
                 try:
                     self._observers.pop().callback(r)
@@ -60,7 +60,7 @@ class ObservableDeferred(object):
             return r
 
         def errback(f):
-            self._result = (False, f)
+            object.__setattr__(self, "_result", (False, f))
             while self._observers:
                 try:
                     self._observers.pop().errback(f)
@@ -97,3 +97,8 @@ class ObservableDeferred(object):
 
     def __setattr__(self, name, value):
         setattr(self._deferred, name, value)
+
+    def __repr__(self):
+        return "<ObservableDeferred object at %s, result=%r, _deferred=%r>" % (
+            id(self), self._result, self._deferred,
+        )