MCPcopy Create free account
hub / github.com/tox-dev/filelock / _backends

Function _backends

tasks/benchmark.py:59–65  ·  view source on GitHub ↗
(root: Path)

Source from the content-addressed store, hash-verified

57
58
59def _backends(root: Path) -> Iterator[tuple[str, Callable[[], filelock.BaseFileLock]]]:
60 # Each entry builds a fresh lock on its own path so no two cases contend. ReadWriteLock is soft-optional, so it is
61 # measured separately where it applies rather than through this exclusive-lock set.
62 yield "FileLock", lambda: FileLock(str(root / "file.lock"))
63 yield "SoftFileLock", lambda: SoftFileLock(str(root / "soft.lock"))
64 yield "StrictSoftFileLock", lambda: StrictSoftFileLock(str(root / "strict.lock"))
65 yield "SoftFileLease", lambda: SoftFileLease(str(root / "lease.lock"), lease_duration=30)
66
67
68def _uncontended(root: Path) -> list[Sample]:

Callers 2

mainFunction · 0.85
_uncontendedFunction · 0.85

Calls 3

SoftFileLockClass · 0.90
StrictSoftFileLockClass · 0.90
SoftFileLeaseClass · 0.90

Tested by

no test coverage detected