summary refs log tree commit diff
path: root/host/Rory-nginx/services/matrix/synapse/workers/module.nix
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-09-07 04:39:53 +0200
committerRory& <root@rory.gay>2024-09-09 21:39:55 +0200
commit7a86ca69369e527168b0c402724d1d4b839d25e9 (patch)
tree7327ee40048dbf24ec0eaa80be5533222320178e /host/Rory-nginx/services/matrix/synapse/workers/module.nix
parentUpdate flake.lock to fix merge conflict (diff)
downloadRory-Open-Architecture-7a86ca69369e527168b0c402724d1d4b839d25e9.tar.xz
Synapse worker changes
Diffstat (limited to 'host/Rory-nginx/services/matrix/synapse/workers/module.nix')
-rw-r--r--host/Rory-nginx/services/matrix/synapse/workers/module.nix47
1 files changed, 45 insertions, 2 deletions
diff --git a/host/Rory-nginx/services/matrix/synapse/workers/module.nix b/host/Rory-nginx/services/matrix/synapse/workers/module.nix
index 87e014e..a02540c 100644
--- a/host/Rory-nginx/services/matrix/synapse/workers/module.nix
+++ b/host/Rory-nginx/services/matrix/synapse/workers/module.nix
@@ -14,7 +14,7 @@ in
     ./single/appservice.nix
     ./single/background.nix
     ./single/user-dir.nix
-    
+
     ./auth.nix
     ./client-reader.nix
     ./event-creator.nix
@@ -25,7 +25,15 @@ in
     ./pusher.nix
     ./sync.nix
 
+    ./stream-writers/account_data-stream-writer.nix
     ./stream-writers/event-stream-writer.nix
+    ./stream-writers/presence-stream-writer.nix
+    ./stream-writers/push_rule-stream-writer.nix
+    ./stream-writers/receipt-stream-writer.nix
+    ./stream-writers/to_device-stream-writer.nix
+    ./stream-writers/typing-stream-writer.nix
+
+    ./stream-writers/shared-stream-writer.nix
   ];
   options.services.matrix-synapse = {
     enableWorkers = lib.mkEnableOption "Enable dedicated workers";
@@ -49,9 +57,11 @@ in
     typingStreamWriters = mkIntOption "Number of typing stream writers";
     toDeviceStreamWriters = mkIntOption "Number of to_device stream writers";
     accountDataStreamWriters = mkIntOption "Number of account data stream writers";
-    receiptsStreamWriters = mkIntOption "Number of read receipt stream writers";
+    receiptStreamWriters = mkIntOption "Number of read receipt stream writers";
     presenceStreamWriters = mkIntOption "Number of presence stream writers";
     pushRuleStreamWriters = mkIntOption "Number of push rule stream writers";
+    
+    sharedStreamWriters = mkIntOption "Number of shared stream writers";
 
     nginxVirtualHostName = lib.mkOption {
       type = lib.types.str;
@@ -66,6 +76,39 @@ in
         assertion = cfg.enableWorkers -> cfg.nginxVirtualHostName != null;
         message = "nginxVirtualHostName must be set when enableWorkers is true";
       }
+
+
+      # Stream types and count limitations: https://github.com/element-hq/synapse/blob/develop/synapse/config/workers.py#L344
+      {
+        assertion = cfg.typingStreamWriters <= 1;
+        message = "Only one typing stream writer is supported";
+      }
+      {
+        assertion = cfg.toDeviceStreamWriters <= 1;
+        message = "Only one to_device stream writer is supported";
+      }
+      {
+        assertion = cfg.accountDataStreamWriters <= 1;
+        message = "Only one account data stream writer is supported";
+      }
+      # This may be outdated in the documentation...?
+      #{
+      #  assertion = cfg.receiptStreamWriters <= 1;
+      #  message = "Only one receipt stream writer is supported";
+      #}
+      {
+        assertion = cfg.presenceStreamWriters <= 1;
+        message = "Only one presence stream writer is supported";
+      }
+      {
+        assertion = cfg.pushRuleStreamWriters <= 1;
+        message = "Only one push rule stream writer is supported";
+      }
+      
+      {
+        assertion = cfg.sharedStreamWriters <= 1;
+        message = "Only one shared stream writer is supported";
+      }
     ];
   };
 }