no, ad hoc

This commit is contained in:
Mike Bayer
2012-10-29 17:04:03 -04:00
parent b58baca455
commit e2ee02338e

View File

@@ -227,10 +227,10 @@ pass to :class:`.Lock` using the ``key`` argument::
def decorate(fn):
# ... gen_cached() from the previous example goes here
# create an ad-hoc FileLock
mutex = lockfile.FileLock(lock_path)
def invoke():
# create an ad-hoc FileLock
mutex = lockfile.FileLock(lock_path)
with Lock(mutex, gen_cached, get_value, expiration_time) as value:
return value
return invoke