Synced
CoordinatedFileLease.AcquireAsync
Section titled “CoordinatedFileLease.AcquireAsync”
- Acquires owner reading rights before opening or waiting for a leaf lease.
Required contracts
Section titled “Required contracts”API: engine
Project: Inno.Core.IO
Declaration
Section titled “Declaration”public static System.Threading.Tasks.ValueTask<Inno.Core.IO.CoordinatedFileLease> Inno.Core.IO.CoordinatedFileLease.AcquireAsync(string coordinationPath, string leafPath, System.TimeSpan timeout, bool shared = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))Parameters
Section titled “Parameters”Parameter coordinationPath: The persistent owner gate, never removed by retirement.
Parameter leafPath: A distinct leaf path within the same owner boundary.
Parameter timeout: The complete wait budget, or infinite.
Parameter shared: Whether the leaf permits simultaneous readers.
Parameter cancellationToken: Cancellation while waiting for either gate.
Returns
Section titled “Returns”Ownership retaining both gates until disposal.
Exceptions
Section titled “Exceptions”Exception T:System.ArgumentException: A path is relative, the leaf escapes its owner, or the budget is invalid.
Exception T:System.TimeoutException: The complete wait budget expires.
Exception T:System.OperationCanceledException: The caller cancels before ownership is returned.