-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: read all chunks in queue since we have interval in listener #337
Conversation
@@ -42,6 +44,10 @@ def put(self, obj, **kwargs): | |||
except: # noqa # queue might be closed | |||
pass | |||
|
|||
def get_all(self) -> List[bytes]: | |||
with self.lock: | |||
return [self.get() for _ in range(self.qsize())] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not tried it at Mac, but there is a comment in the code.
def qsize(self):
# Raises NotImplementedError on Mac OSX because of broken sem_getvalue()
return self._maxsize - self._sem._semlock._get_value()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice point. i'll use the try except get
then
21dfc95
to
748ac58
Compare
@hfudev Thank you for looking into this. My original issue still exists, but at least the 100ms sleep effect will be resolved. |
related to #334