[ZODB-Dev] ZEO pack
Greg Ward
gward@mems-exchange.org
Wed, 26 Sep 2001 10:27:01 -0400
On 26 September 2001, Jeremy Hylton said:
> The pack() method on a ClientStorage has an optional argument wait.
> If you call pack(wait=1), it should block until the pack is completed.
Ahh, that's good to know about. The 'wait' argument would be more
useful if DB.pack() knew about it, and if other storages supported it
(even if only by defaulting to 1 and ignoring it). Where I used to do
this:
db = get_database()
db.pack(time.time())
I now have to do this for consistently blocking packs:
from ZODB.referencesf import referencesf
from ZEO.ClientStorage import ClientStorage
[...]
storage = get_storage()
now = time.time()
if isinstance(storage, ClientStorage):
storage.pack(now, referencesf, wait=1)
else:
storage.pack(now, referencesf)
That beats sitting around waiting for the ".db.old" file to appear, but
it's still sub-optimal.
But I don't see a way to add 'wait' to the BaseStorage.pack() interface
without breaking any third-party storages. ;-(
Greg