diff options
| author | klm | 1998-10-22 00:48:50 +0000 |
|---|---|---|
| committer | klm | 1998-10-22 00:48:50 +0000 |
| commit | 25ebeae2168ffa3c811366fe45a54bac254037b7 (patch) | |
| tree | 25a9ddc8257f21f1d0a57d555de5d95e2e6abc88 /Mailman/HyperDatabase.py | |
| parent | cf3105606e565e7cf6313b0eb53732a0ee1b34ba (diff) | |
| download | mailman-25ebeae2168ffa3c811366fe45a54bac254037b7.tar.gz mailman-25ebeae2168ffa3c811366fe45a54bac254037b7.tar.zst mailman-25ebeae2168ffa3c811366fe45a54bac254037b7.zip | |
Redid pending.py to:
1. Eliminate an unlocked window, where another process could also load
the db, then save after the current process and stomp its changes.
All transactions are now atomically locked.
2. Implement periodic culling of the db, to remove old entries.
Otherwise (i assume) unclaimed entries would just accumulate
forever.
3. Simplified the interface so you can only put in new entries and
retrieve them. Cookie handling is implicit. All external
functionality is now all in two methods of the 'Pending' class object.
Details:
1. Atomicity: it used to be that the lock would only be set during the
write phase. Now, the db load and save handling is not exposed - it
is taken care of in the two exposed methods, which take care of the
locking around the load/save sequence.
Pending().new(stuff...) places an item's data in the db, returning its cookie.
Pending().confirmed(cookie) returns a tuple for the data, removing the item
from the db. It returns None if the cookie is not registered.
2. Periodically, on saves that occur longer than (module var)
CULL_INTERVAL after the last save, the db is checked for stale items,
and they're removed. Items are stale if they're older than the value
of the new default config var, PENDING_REQUEST_LIFE. (The timestamp
on the db is new, but old versions lacking it will just be culled on
the first save, and have it added.)
3. Two methods provide all the functionality:
Pending().new(stuff...) places an item in the db, returning a cookie
for it.
Pending().confirmed(cookie) returns the item, removing it from the
db - or it returns None if the item is not found.
Diffstat (limited to 'Mailman/HyperDatabase.py')
0 files changed, 0 insertions, 0 deletions
