This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bpb
Recipients bpb, rhettinger
Date 2009-11-18.09:44:45
SpamBayes Score 4.1157006e-07
Marked as misclassified No
Message-id <1258537488.43.0.265340676974.issue7337@psf.upfronthosting.co.za>
In-reply-to
Content
'connectionless' is from how I see it as an analogy with UDP (vs TCP); 
why not just use a deque is primarily about having the same API - a 
client (getter) of the queue shouldn't know or care whether it is a 
'lossy' queue or a normal queue.  I guess most uses of a normal queue 
(excepting the 'task' functions) could just use a deque, but it wouldn't 
feel natural.

Use cases: non-critical event/status reporting is my canonical example.
Specific examples:
 - a program which executes a long running process in a thread. It wants 
to update a GUI progress bar or similar, which must occur in a different 
thread because of the GUI model. By using a LossyQueue, the server 
thread is simplified; it doesn't have to care whether anything is 
listening on the other end, allowing greater decoupling (e.g. no changes 
required if there isn't a GUI). LossyQueues become part of the interface 
which can be used or not as required.
 - emulating/providing wrapper around UDP sockets
 - many application protocols support a get/set/report type interface 
with the addition of asynchronous events (e.g. SNMP, Netconf, SCPI).  In 
these type of applications a suitable abstraction might be a normal 
Queue(s) for the standard commands and a LossyQueue for the events 
(which some applications might not care about).  The point is that to 
the user of this abstraction, these two interfaces look the same.

The 'server' doesn't care if a client is listening or not (it won't 
block and it won't use unlimited memory)
The 'client' (if it wants to use it) doesn't know that it isn't a normal 
queue (same API).
-> decouples server and client tasks.
History
Date User Action Args
2009-11-18 09:44:48bpbsetrecipients: + bpb, rhettinger
2009-11-18 09:44:48bpbsetmessageid: <1258537488.43.0.265340676974.issue7337@psf.upfronthosting.co.za>
2009-11-18 09:44:46bpblinkissue7337 messages
2009-11-18 09:44:45bpbcreate