aglinxinyuan commented on code in PR #6522:
URL: https://github.com/apache/texera/pull/6522#discussion_r3609352824
##########
amber/src/main/python/core/models/internal_queue.py:
##########
@@ -74,6 +74,14 @@ def is_empty(self, key=None) -> bool:
def get(self) -> T:
return self._queue.get()
+ def peek(self) -> Optional[T]:
+ """
+ Peek the element that get() would return next, without removing it.
+
+ :return: Optional[T], the next available element, or None if empty.
+ """
+ return self._queue.peek()
Review Comment:
Good point — dropped `peek()` entirely so `InternalQueue` stays non-peekable
like `queue.Queue`. The handler doesn't actually need the next message's
content: it now logs the pending count via the existing `len()`/`is_empty()`
and raises, which is all that's needed to fail the RPC and let the coordinator
retry. No internal API exposed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]