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