mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Documentation
This commit is contained in:
parent
1f24c2e589
commit
73513ececc
@ -305,10 +305,13 @@ class Notifier(object):
|
|||||||
|
|
||||||
result = None
|
result = None
|
||||||
if timeout:
|
if timeout:
|
||||||
listener = None
|
listener = None # Will be set to a _NotificationListener that
|
||||||
timer = self.clock.call_later(
|
# we'll be waiting on. Allows us to cancel it.
|
||||||
timeout/1000., lambda: listener.deferred.cancel()
|
|
||||||
)
|
def timed_out():
|
||||||
|
if listener:
|
||||||
|
listener.deferred.cancel()
|
||||||
|
timer = self.clock.call_later(timeout/1000., timed_out)
|
||||||
|
|
||||||
prev_token = from_token
|
prev_token = from_token
|
||||||
while not result:
|
while not result:
|
||||||
@ -319,6 +322,10 @@ class Notifier(object):
|
|||||||
if result:
|
if result:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
# Now we wait for the _NotifierUserStream to be told there
|
||||||
|
# is a new token.
|
||||||
|
# We need to supply the token we supplied to callback so
|
||||||
|
# that we don't miss any current_token updates.
|
||||||
prev_token = current_token
|
prev_token = current_token
|
||||||
listener = user_stream.new_listener(prev_token)
|
listener = user_stream.new_listener(prev_token)
|
||||||
yield listener.deferred
|
yield listener.deferred
|
||||||
|
Loading…
Reference in New Issue
Block a user