fleche.storage.file

Attributes

logger

Classes

FileStorage

File-based storage backend using pickle.

Functions

file_write_lock(→ Generator[None, None, None])

Context manager for acquiring a write lock on a file.

file_read_lock(→ Generator[None, None, None])

Context manager for acquiring a read lock on a file.

Module Contents

fleche.storage.file.logger[source]
fleche.storage.file.file_write_lock(lock_path: pathlib.Path) Generator[None, None, None][source]

Context manager for acquiring a write lock on a file.

Creates a lock file with hostname, PID, and timestamp.

fleche.storage.file.file_read_lock(lock_path: pathlib.Path, timeout: float, wait_start: float, key: str) Generator[None, None, None][source]

Context manager for acquiring a read lock on a file.

Waits for a lock file to be removed with exponential backoff.

class fleche.storage.file.FileStorage[source]

Bases: fleche.storage.base.StorageBackend

File-based storage backend using pickle.

Stores objects on the filesystem.

root: pathlib.Path[source]
lock_timeout: float = 1.0[source]
lock_wait_start: float = 0.001[source]
__post_init__() None[source]
_path(key: str) pathlib.Path[source]
list() Iterable[fleche.digest.Digest][source]
_evict(key: fleche.digest.Digest) None[source]
put(value: Any, key: fleche.digest.Digest) fleche.digest.Digest[source]
get(key: fleche.digest.Digest) Any[source]
abstractmethod _to_file(value: Any, path: pathlib.Path) None[source]
abstractmethod _from_file(path: pathlib.Path) Any[source]
_contains(key: fleche.digest.Digest) bool[source]