|
@@ -58,6 +58,15 @@ class Command(metaclass=abc.ABCMeta):
|
|
|
# by default, we just use the command name.
|
|
|
return self.NAME
|
|
|
|
|
|
+ def redis_channel_name(self, prefix: str) -> str:
|
|
|
+ """
|
|
|
+ Returns the Redis channel name upon which to publish this command.
|
|
|
+
|
|
|
+ Args:
|
|
|
+ prefix: The prefix for the channel.
|
|
|
+ """
|
|
|
+ return prefix
|
|
|
+
|
|
|
|
|
|
SC = TypeVar("SC", bound="_SimpleCommand")
|
|
|
|
|
@@ -395,6 +404,9 @@ class UserIpCommand(Command):
|
|
|
f"{self.user_agent!r}, {self.device_id!r}, {self.last_seen})"
|
|
|
)
|
|
|
|
|
|
+ def redis_channel_name(self, prefix: str) -> str:
|
|
|
+ return f"{prefix}/USER_IP"
|
|
|
+
|
|
|
|
|
|
class RemoteServerUpCommand(_SimpleCommand):
|
|
|
"""Sent when a worker has detected that a remote server is no longer
|