Function pact_models::file_utils::with_read_lock_for_open_file[][src]

pub fn with_read_lock_for_open_file<T>(
    path: &Path,
    file: &mut File,
    attempts: u32,
    cl: &mut dyn FnMut(&mut File) -> Result<T>
) -> Result<T>
Expand description

Attempts to get a read lock on the open file before proceeding with the provided closure. Has an exponential back-off (100, 1000, 10000 ms), and will return an error if unable to get the lock withing the provided number of attempts.