Skip to main content

acquire

Function acquire 

Source
pub fn acquire(target: &Utf8Path) -> Result<TargetLock, RkError>
Expand description

Take target for this run, or refuse.

Exclusive ownership or a refusal, never a silent pass. Where no state root resolves there is nowhere to put the lock, and an apply that proceeds anyway is the unguarded apply this module exists to stop, so it refuses before it stages. A second location is no answer either: a run that locked elsewhere would not exclude a run that locked here, and two processes disagreeing about where the lock lives hold no lock at all.

ยงErrors

Returns a target-busy refusal where another run holds the target, a prerequisite-unmet refusal where no state root resolves, and RkError::Io where the lock cannot be written.