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

Function _backends

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

Source from the content-addressed store, hash-verified

66
67
68def _backends(root: Path) -> Iterator[tuple[str, Callable[[], filelock.BaseFileLock]]]:
69 # Each entry builds a fresh lock on its own path so no two cases contend. ReadWriteLock is soft-optional, so it is
70 # measured separately where it applies rather than through this exclusive-lock set.
71 yield "FileLock", lambda: FileLock(str(root / "file.lock"))
72 yield "SoftFileLock", lambda: SoftFileLock(str(root / "soft.lock"))
73 yield "StrictSoftFileLock", lambda: StrictSoftFileLock(str(root / "strict.lock"))
74 yield "SoftFileLease", lambda: SoftFileLease(str(root / "lease.lock"), lease_duration=30)
75
76
77def _construction(root: Path) -> list[Sample]:

Callers 2

_constructionFunction · 0.85
_uncontendedFunction · 0.85

Calls 3

SoftFileLockClass · 0.90
StrictSoftFileLockClass · 0.90
SoftFileLeaseClass · 0.90

Tested by

no test coverage detected