def read_transaction(self, key): """Get a read transaction on a file cache item. Returns a ReadTransaction context manager and opens the cache file for reading. You can use it like this: with file_cache_object.read_transaction(key) as cache_file: cache_file.read() """ return ReadTransaction(self._get_lock(key), acquire=lambda: open(self.cache_path(key)))
def read_transaction(self): """Get a read lock context manager for use in a `with` block.""" return ReadTransaction(self.lock, self._read)
def read_transaction(self, timeout=_db_lock_timeout): """Get a read lock context manager for use in a `with` block.""" return ReadTransaction(self.lock, self._read, timeout=timeout)