-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Port synapse.replication.tcp to async/await #6666
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so i think this works, however...
the on_foo
methods, and subscribe_to_stream
, are called from on_FOO
methods, which are documented to return Deferreds.
I think you're getting away with it because this means that they are returning a Coroutine, and the thing calling them does a run_as_background_process
on them so is happy with that... but to be correct that code path needs some documentation updates at least.
Yeah, agreed. I could have just documented the functions as returning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm other than the below
synapse/replication/tcp/protocol.py
Outdated
@@ -376,7 +372,7 @@ def connectionLost(self, reason): | |||
|
|||
self.on_connection_closed() | |||
|
|||
def on_connection_closed(self): | |||
async def on_connection_closed(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one isn't called the same way
synapse/replication/tcp/protocol.py
Outdated
"""Called when we get new position data.""" | ||
raise NotImplementedError() | ||
|
||
@abc.abstractmethod | ||
def on_sync(self, data): | ||
async def on_sync(self, data): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the implementations of this don't seem to be async (and it's not awaited
where it is called).
Honestly its like I can't even tell the difference between ALL CAPS and lower case... |
* commit '48c3a9688': Port synapse.replication.tcp to async/await (#6666)
No description provided.