This commit is contained in:
Nuno Campos
2023-09-12 18:07:37 +01:00
parent f03e08d126
commit 53feef5eff
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -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
+2
View File
@@ -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