diff options
author | Erik Johnston <erik@matrix.org> | 2020-04-06 09:58:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-06 09:58:42 +0100 |
commit | 5016b162fcf0372fe35404c64f80aeaf21461f31 (patch) | |
tree | ada419f07f8f7f0c24c214906af43fec0674d27b /synapse/replication/tcp/__init__.py | |
parent | Server notices: Dissociate room creation/lookup from invite (#7199) (diff) | |
download | synapse-5016b162fcf0372fe35404c64f80aeaf21461f31.tar.xz |
Move client command handling out of TCP protocol (#7185)
The aim here is to move the command handling out of the TCP protocol classes and to also merge the client and server command handling (so that we can reuse them for redis protocol). This PR simply moves the client paths to the new `ReplicationCommandHandler`, a future PR will move the server paths too.
Diffstat (limited to 'synapse/replication/tcp/__init__.py')
-rw-r--r-- | synapse/replication/tcp/__init__.py | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/synapse/replication/tcp/__init__.py b/synapse/replication/tcp/__init__.py index 81c2ea7ee9..523a1358d4 100644 --- a/synapse/replication/tcp/__init__.py +++ b/synapse/replication/tcp/__init__.py @@ -20,11 +20,31 @@ Further details can be found in docs/tcp_replication.rst Structure of the module: - * client.py - the client classes used for workers to connect to master + * handler.py - the classes used to handle sending/receiving commands to + replication * command.py - the definitions of all the valid commands - * protocol.py - contains bot the client and server protocol implementations, - these should not be used directly - * resource.py - the server classes that accepts and handle client connections - * streams.py - the definitons of all the valid streams + * protocol.py - the TCP protocol classes + * resource.py - handles streaming stream updates to replications + * streams/ - the definitons of all the valid streams + +The general interaction of the classes are: + + +---------------------+ + | ReplicationStreamer | + +---------------------+ + | + v + +---------------------------+ +----------------------+ + | ReplicationCommandHandler |---->|ReplicationDataHandler| + +---------------------------+ +----------------------+ + | ^ + v | + +-------------+ + | Protocols | + | (TCP/redis) | + +-------------+ + +Where the ReplicationDataHandler (or subclasses) handles incoming stream +updates. """ |