summary refs log tree commit diff
path: root/synapse/server.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-07-18 15:22:02 +0100
committerErik Johnston <erik@matrix.org>2018-07-18 15:33:03 +0100
commit8cb8df55e9bb5de27d9e6570441560eb81db36df (patch)
tree26768e4be0eb266527f6cf72a953c91295e6fbc9 /synapse/server.py
parentMerge pull request #3367 from matrix-org/rav/drop_re_signing_hacks (diff)
downloadsynapse-8cb8df55e9bb5de27d9e6570441560eb81db36df.tar.xz
Split MessageHandler into read only and writers
This will let us call the read only parts from workers, and so be able
to move some APIs off of master, e.g. the `/state` API.
Diffstat (limited to 'synapse/server.py')
-rw-r--r--synapse/server.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/synapse/server.py b/synapse/server.py
index 92bea96c5c..b93bd6d7d9 100644
--- a/synapse/server.py
+++ b/synapse/server.py
@@ -52,7 +52,11 @@ from synapse.handlers.e2e_keys import E2eKeysHandler
 from synapse.handlers.events import EventHandler, EventStreamHandler
 from synapse.handlers.groups_local import GroupsLocalHandler
 from synapse.handlers.initial_sync import InitialSyncHandler
-from synapse.handlers.message import EventCreationHandler
+from synapse.handlers.message import (
+    EventCreationHandler,
+    MessageHandler,
+    PaginationHandler,
+)
 from synapse.handlers.presence import PresenceHandler
 from synapse.handlers.profile import ProfileHandler
 from synapse.handlers.read_marker import ReadMarkerHandler
@@ -163,6 +167,8 @@ class HomeServer(object):
         'federation_registry',
         'server_notices_manager',
         'server_notices_sender',
+        'message_handler',
+        'pagination_handler',
     ]
 
     def __init__(self, hostname, reactor=None, **kwargs):
@@ -426,6 +432,12 @@ class HomeServer(object):
             return WorkerServerNoticesSender(self)
         return ServerNoticesSender(self)
 
+    def build_message_handler(self):
+        return MessageHandler(self)
+
+    def build_pagination_handler(self):
+        return PaginationHandler(self)
+
     def remove_pusher(self, app_id, push_key, user_id):
         return self.get_pusherpool().remove_pusher(app_id, push_key, user_id)