diff options
author | Sean Quah <8349537+squahtx@users.noreply.github.com> | 2021-10-22 18:15:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-22 18:15:41 +0100 |
commit | 2b82ec425fccb0ef626242779f7ccd4d77a0685c (patch) | |
tree | d541487cf7936d98807c5b1ef5128bb1bb5c783c /synapse/replication/tcp/resource.py | |
parent | Fix synapse.config module "read" command (#11145) (diff) | |
download | synapse-2b82ec425fccb0ef626242779f7ccd4d77a0685c.tar.xz |
Add type hints for most `HomeServer` parameters (#11095)
Diffstat (limited to 'synapse/replication/tcp/resource.py')
-rw-r--r-- | synapse/replication/tcp/resource.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/replication/tcp/resource.py b/synapse/replication/tcp/resource.py index 80f9b23bfd..55326877fd 100644 --- a/synapse/replication/tcp/resource.py +++ b/synapse/replication/tcp/resource.py @@ -16,6 +16,7 @@ import logging import random +from typing import TYPE_CHECKING from prometheus_client import Counter @@ -27,6 +28,9 @@ from synapse.replication.tcp.protocol import ServerReplicationStreamProtocol from synapse.replication.tcp.streams import EventsStream from synapse.util.metrics import Measure +if TYPE_CHECKING: + from synapse.server import HomeServer + stream_updates_counter = Counter( "synapse_replication_tcp_resource_stream_updates", "", ["stream_name"] ) @@ -37,7 +41,7 @@ logger = logging.getLogger(__name__) class ReplicationStreamProtocolFactory(Factory): """Factory for new replication connections.""" - def __init__(self, hs): + def __init__(self, hs: "HomeServer"): self.command_handler = hs.get_tcp_replication() self.clock = hs.get_clock() self.server_name = hs.config.server.server_name @@ -65,7 +69,7 @@ class ReplicationStreamer: data is available it will propagate to all connected clients. """ - def __init__(self, hs): + def __init__(self, hs: "HomeServer"): self.store = hs.get_datastore() self.clock = hs.get_clock() self.notifier = hs.get_notifier() |