summaryrefslogtreecommitdiff
path: root/src/mailman/interfaces/pending.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/interfaces/pending.py')
-rw-r--r--src/mailman/interfaces/pending.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mailman/interfaces/pending.py b/src/mailman/interfaces/pending.py
index c921123de..59890ee03 100644
--- a/src/mailman/interfaces/pending.py
+++ b/src/mailman/interfaces/pending.py
@@ -37,6 +37,14 @@ from zope.interface import Interface, Attribute
class IPendable(Interface):
"""A pendable object."""
+ PEND_TYPE = Attribute(
+ """The type of this pendable.
+
+ Subclasses must define this attribute, and it must be a unique string;
+ it's used to efficiently search for all pendables of the given type.
+ The PEND_TYPE "type" is reserved.
+ """)
+
def keys():
"""The keys of the pending event data, all of which are strings."""
@@ -95,6 +103,16 @@ class IPendings(Interface):
def evict():
"""Remove all pended items whose lifetime has expired."""
+ def find(mlist=None, pend_type=None):
+ """Search for the pendables matching the given criteria.
+
+ :param mlist: The MailingList object that the pendables must be
+ related to.
+ :param pend_type: The type of the pendables that are looked for, this
+ corresponds to the `PEND_TYPE` attribute.
+ :return: An iterator over 2-tuples of the form (token, dict).
+ """
+
def __iter__():
"""An iterator over all pendables.