Documentation
¶
Overview ¶
Package flock provides a small cross-process advisory file lock.
Multiple LabLinkServer processes can share the same operator config directory (one per AI client session). Without an OS-level lock, plain in-process mutexes are not enough to keep nodes.json or history.jsonl consistent across processes. This package wraps platform-specific locking primitives behind a single Lock/Unlock interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Locker ¶
type Locker struct {
// contains filtered or unexported fields
}
Locker is an exclusive, blocking advisory file lock. Lock blocks until the lock is acquired. Close releases the lock and the underlying file handle.
func Lock ¶
Lock opens (creating if needed) the named file and acquires an exclusive advisory lock on it. Callers must Close the returned Locker to release it.
The lock file itself is a sidecar — it never holds data. Use a path like "<target>.lock" so that operations on <target> can be serialised across processes without holding a handle on <target> itself.