DatabaseFileMonitor

class passengersim.database.files.DatabaseFileMonitor(refresh: Callable[[], None], interval: float = 2.0)[source]

Bases: object

Share one background metadata poller among the live dashboard’s runs.

Parameters:
refresh : callable

Throttled dashboard refresh, called without holding the monitor lock.

interval : float, optional

Poll interval in seconds; defaults to two seconds.

Notes

Filesystem calls never hold the display or registration locks. Stopping signals the daemon thread and waits briefly, so a slow network filesystem cannot delay simulation cleanup indefinitely.

Methods

__init__(refresh[, interval])

close()

Release all histories and stop polling when the dashboard closes.

register(key, paths)

Register known paths, starting the shared poller only when needed.

remove(key)

Forget a finished run and stop polling when no registered runs remain.

snapshot()

Copy cached display data without touching the filesystem.

register(key: str, paths: Iterable[Path]) → None[source]

Register known paths, starting the shared poller only when needed.

remove(key: str) → None[source]

Forget a finished run and stop polling when no registered runs remain.

close() → None[source]

Release all histories and stop polling when the dashboard closes.

snapshot() → dict[str, tuple[tuple[Path, ...], tuple[FileSize, ...]]][source]

Copy cached display data without touching the filesystem.

Returns:

dict – Run identifiers mapped to known main paths and observed file rows.