From 0e80272764273017343645aa432f0277828d8ec4 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Fri, 15 Sep 2023 11:59:11 +0100 Subject: [PATCH] Support any nr of parts in full_topic_name --- permchain/connection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/permchain/connection.py b/permchain/connection.py index ad96edd96..6380ac670 100644 --- a/permchain/connection.py +++ b/permchain/connection.py @@ -12,9 +12,9 @@ class LogMessage(TypedDict): class PubSubConnection(ABC): - def full_topic_name(self, prefix: str, topic_name: str) -> str: + def full_topic_name(self, prefix: str, *parts: str) -> str: """Return the full topic name for a given prefix and topic name.""" - return f"{prefix}:{topic_name}" + return ":".join(map(str, [prefix, *parts])) @abstractmethod def iterate(self, prefix: str, topic_name: str, wait: bool) -> Iterator[Any]: