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
Add lossy queue to queue library module #51586
Comments
Many applications would benefit from 'connectionless' queues, i.e. they Outline as follows: class LossyQueue(Queue):
"Queue subclass which drops items on overflow"
def _init(self, maxsize):
if maxsize > 0:
# build the deque with maxsize limit
self.queue = deque(maxlen=maxsize)
else:
# same as normal Queue instance
self.queue = collections.deque()
# deque alone handles maxsize,
# so we pretend we have none
self.maxsize = 0 if there is interest in this I will offer a proper patch with docs and |
I'm curious about your "many applications would benefit from |
'connectionless' is from how I see it as an analogy with UDP (vs TCP); Use cases: non-critical event/status reporting is my canonical example.
The 'server' doesn't care if a client is listening or not (it won't |
I think it would be better to put this in the ASPN recipes cookbook to let it mature and gather a following. Right now, it is not at all clear that this is the right thing to do. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: