summary refs log tree commit diff
path: root/synapse/config/workers.py
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2016-06-17 10:58:52 +0100
committerGitHub <noreply@github.com>2016-06-17 10:58:52 +0100
commitf1073ad43d04dfbdc12474a4d4ccc1be3617fa77 (patch)
treed519760f3b97d578c741d5062223189157285a99 /synapse/config/workers.py
parentMerge pull request #873 from vt0r/bugfix/bcrypt-utf8-encode (diff)
parentUse worker_ prefixes for worker config, use existing support for multiple con... (diff)
downloadsynapse-f1073ad43d04dfbdc12474a4d4ccc1be3617fa77.tar.xz
Merge pull request #874 from matrix-org/markjh/worker_config
Inline the synchrotron and pusher configs into the main config
Diffstat (limited to 'synapse/config/workers.py')
-rw-r--r--synapse/config/workers.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/synapse/config/workers.py b/synapse/config/workers.py
new file mode 100644
index 0000000000..904789d155
--- /dev/null
+++ b/synapse/config/workers.py
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+# Copyright 2016 matrix.org
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from ._base import Config
+
+
+class WorkerConfig(Config):
+    """The workers are processes run separately to the main synapse process.
+    They have their own pid_file and listener configuration. They use the
+    replication_url to talk to the main synapse process."""
+
+    def read_config(self, config):
+        self.worker_app = config.get("worker_app")
+        self.worker_listeners = config.get("worker_listeners")
+        self.worker_daemonize = config.get("worker_daemonize")
+        self.worker_pid_file = config.get("worker_pid_file")
+        self.worker_log_file = config.get("worker_log_file")
+        self.worker_log_config = config.get("worker_log_config")
+        self.worker_replication_url = config.get("worker_replication_url")