mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:06:05 -04:00
Add ability to run replication protocol over redis. (#7040)
This is configured via the `redis` config options.
This commit is contained in:
parent
5308239d5d
commit
51f7eaf908
12 changed files with 342 additions and 36 deletions
|
@ -454,3 +454,21 @@ VALID_CLIENT_COMMANDS = (
|
|||
ErrorCommand.NAME,
|
||||
RemoteServerUpCommand.NAME,
|
||||
)
|
||||
|
||||
|
||||
def parse_command_from_line(line: str) -> Command:
|
||||
"""Parses a command from a received line.
|
||||
|
||||
Line should already be stripped of whitespace and be checked if blank.
|
||||
"""
|
||||
|
||||
idx = line.index(" ")
|
||||
if idx >= 0:
|
||||
cmd_name = line[:idx]
|
||||
rest_of_line = line[idx + 1 :]
|
||||
else:
|
||||
cmd_name = line
|
||||
rest_of_line = ""
|
||||
|
||||
cmd_cls = COMMAND_MAP[cmd_name]
|
||||
return cmd_cls.from_line(rest_of_line)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue