module

BuildLock

Exclusive lock guarding commands that write output/ and the task store: two nicolino processes running concurrently (e.g. a long-lived auto server and a one-off build) read and write the same state and corrupt each other's results. The lock is held for the whole process lifetime and released automatically on exit, so stale locks are impossible: a leftover .nicolino.lock is only ever a leftover file, never a stuck lock.

Constants

PATH = ".nicolino.lock"

Class methods

acquire

Try to acquire the lock without blocking. Returns the open file (keep it open for as long as the lock is needed) or nil when another process holds it.

Source