Common
common
Small helpers shared by the readers: a bounded mapping and durable file writes.
Lru
Mapping keeping the maxsize most recently used entries (not thread-safe).
Source code in packages/barograph-met/src/baro/met/common.py
write_atomic(path, data)
Write path durably: temporary file, fsync, rename, fsync of the directory.
Readers never see a partial file, and after a crash the file is either absent or complete (a rename alone may leave an empty file on some filesystems after a power loss).