On Feb 12, 2007, at 10:01 AM, Manuel Vazquez Acosta wrote:

Hi Gary,

Although the shared buffer indeed has a queue-like interface there's a catch for my needs. I need that pull method to retrieve the item in the head and to move the head forward, and not to remove the item from the buffer. Just like zc.queue I need a single copy of a item in the queue, but I also need this uniqueness over the time, so that any item which has being consumed already, does not get back to buffer.

Ah, OK.

FWIW, you could get the same functionality with a wrapper around a zc.queue pretty easily, of course, with at least a couple of variants off the top of my head (both involving an additional data structure that you maintain, and supplying your own `put` and `pull` that wrap the zc.queue methods, either with composition or inheritance).

If, instead, you move to a multi-threaded model following the same approach you outlined before (sequential int keys, IIUC) you'll need to be careful of write conflict errors.

For more information about ZODB, see the ZODB Wiki:

ZODB-Dev mailing list  -  ZODB-Dev@zope.org

Reply via email to