summary refs log tree commit diff
path: root/synapse/notifier.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-06-18 16:09:53 +0100
committerErik Johnston <erik@matrix.org>2015-06-18 16:09:53 +0100
commit1f24c2e5896c1c9e5c7fded779fdb0ddcf2a3801 (patch)
tree6f9ec86e2aeaed30f7ce0dc4b39f2b8d1682f6c4 /synapse/notifier.py
parentRefactor the notifier.wait_for_events code to be clearer. Add _NotifierUserSt... (diff)
downloadsynapse-1f24c2e5896c1c9e5c7fded779fdb0ddcf2a3801.tar.xz
Don't bother proxying lookups on _NotificationListener to underlying deferred
Diffstat (limited to '')
-rw-r--r--synapse/notifier.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/synapse/notifier.py b/synapse/notifier.py
index e441561029..053475a2f5 100644
--- a/synapse/notifier.py
+++ b/synapse/notifier.py
@@ -48,13 +48,7 @@ class _NotificationListener(object):
     __slots__ = ["deferred"]
 
     def __init__(self, deferred):
-        object.__setattr__(self, "deferred", deferred)
-
-    def __getattr__(self, name):
-        return getattr(self.deferred, name)
-
-    def __setattr__(self, name, value):
-        setattr(self.deferred, name, value)
+        self.deferred = deferred
 
 
 class _NotifierUserStream(object):
@@ -313,14 +307,12 @@ class Notifier(object):
         if timeout:
             listener = None
             timer = self.clock.call_later(
-                timeout/1000., lambda: listener.cancel()
+                timeout/1000., lambda: listener.deferred.cancel()
             )
 
             prev_token = from_token
             while not result:
                 try:
-                    # We need to start listening to the streams *before* doing
-                    # the callback, as otherwise we may miss something.
                     current_token = user_stream.current_token
 
                     result = yield callback(prev_token, current_token)