summary refs log tree commit diff
path: root/synapse/replication/tcp/commands.py
diff options
context:
space:
mode:
authorMathieu Velten <mathieuv@matrix.org>2023-08-28 16:03:51 +0200
committerGitHub <noreply@github.com>2023-08-28 14:03:51 +0000
commit501da8ecd8f056fb953fbccb43fc60ba9edb91d5 (patch)
tree105c60042edb051abd9e844b48e205efba2065a7 /synapse/replication/tcp/commands.py
parentBump serde from 1.0.184 to 1.0.188 (#16194) (diff)
downloadsynapse-501da8ecd8f056fb953fbccb43fc60ba9edb91d5.tar.xz
Task scheduler: add replication notify for new task to launch ASAP (#16184)
Diffstat (limited to 'synapse/replication/tcp/commands.py')
-rw-r--r--synapse/replication/tcp/commands.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/synapse/replication/tcp/commands.py b/synapse/replication/tcp/commands.py
index 10f5c98ff8..58a871c6d9 100644
--- a/synapse/replication/tcp/commands.py
+++ b/synapse/replication/tcp/commands.py
@@ -452,6 +452,17 @@ class LockReleasedCommand(Command):
         return json_encoder.encode([self.instance_name, self.lock_name, self.lock_key])
 
 
+class NewActiveTaskCommand(_SimpleCommand):
+    """Sent to inform instance handling background tasks that a new active task is available to run.
+
+    Format::
+
+        NEW_ACTIVE_TASK "<task_id>"
+    """
+
+    NAME = "NEW_ACTIVE_TASK"
+
+
 _COMMANDS: Tuple[Type[Command], ...] = (
     ServerCommand,
     RdataCommand,
@@ -466,6 +477,7 @@ _COMMANDS: Tuple[Type[Command], ...] = (
     RemoteServerUpCommand,
     ClearUserSyncsCommand,
     LockReleasedCommand,
+    NewActiveTaskCommand,
 )
 
 # Map of command name to command type.