mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 12:06:08 -04:00
Add type hints for the federation sender. (#9681)
Includes an abstract base class which both the FederationSender and the FederationRemoteSendQueue must implement.
This commit is contained in:
parent
4bbd535450
commit
da75d2ea1f
7 changed files with 177 additions and 59 deletions
|
@ -312,16 +312,16 @@ class FederationAckCommand(Command):
|
|||
|
||||
NAME = "FEDERATION_ACK"
|
||||
|
||||
def __init__(self, instance_name, token):
|
||||
def __init__(self, instance_name: str, token: int):
|
||||
self.instance_name = instance_name
|
||||
self.token = token
|
||||
|
||||
@classmethod
|
||||
def from_line(cls, line):
|
||||
def from_line(cls, line: str) -> "FederationAckCommand":
|
||||
instance_name, token = line.split(" ")
|
||||
return cls(instance_name, int(token))
|
||||
|
||||
def to_line(self):
|
||||
def to_line(self) -> str:
|
||||
return "%s %s" % (self.instance_name, self.token)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue