From 53feef5eff84742aef7a4568401d9b5563f7e6f7 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Tue, 12 Sep 2023 18:07:37 +0100 Subject: [PATCH] Lint --- README.md | 1 + permchain/connection.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index cec57e5d3..4ceeb628c 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Check `tests` and `examples` for more examples. - [x] Implement IN as regular topic - [x] Add Connection.peek() to monitor past messages from all topics - [x] Enable resuming PubSub from the "middle" of the computation +- [ ] Add test for .peek() - [ ] Move tracking of inflight processes/messages to Connection - [ ] Use this to build retry mechanism, where any inflight messages are moved back to the respective topics when restarting - [ ] Detect cycles (aka. infinite loops) and throw an error diff --git a/permchain/connection.py b/permchain/connection.py index d988e5862..4f960e635 100644 --- a/permchain/connection.py +++ b/permchain/connection.py @@ -13,10 +13,12 @@ class LogMessage(TypedDict): class PubSubConnection(ABC): def full_topic_name(self, prefix: str, topic_name: str) -> str: + """Return the full topic name for a given prefix and topic name.""" return f"{prefix}:{topic_name}" @abstractmethod def iterate(self, prefix: str, topic_name: str) -> Iterator[Any]: + """Iterate over all currently queued messages for a topic, consuming them.""" ... # TODO add aiterate() method