Persistent queues are simply queues that are optimized for persistency
via the ZODB. They assume that the ZODB is using MVCC to avoid read
conflicts. They attempt to resolve write conflicts so that transactions
that add and remove objects simultaneously are merged, unless the
transactions are trying to remove the same value from the queue.
An important characteristic of these queues is that they do not expect to
hold more than one reference to any given equivalent item at a time. For
instance, some of the conflict resolution features will not perform
desirably if it is reasonable for your application to hold two copies of
the string "hello" within the same queue at once [1].
The module provides two flavors: a simple persistent queue that keeps all
contained objects in one persistent object (Queue), and a persistent queue
that divides up its contents into multiple composite elements
(CompositeQueue). They should be equivalent in terms of API and so are
mostly examined in the abstract in this document: we'll generate
instances with a representative Queue factory, that could be either class.
They only differ in an aspect of their write conflict resolution behavior.
|