API reference@evolu/commonLockManager › acquireLeaderLockCallback

function acquireLeaderLockCallback(
  deps: LockManagerDep,
): (name: string, callback: Callback<void>) => Disposable;

Defined in: packages/common/src/LockManager.ts:161

Competes to become the current leader for name using LockManager.

Only one caller can lead for a given name at a time. The callback runs when leadership is acquired, and the returned Disposable represents that leadership request.

Leadership is held until the returned handle is disposed. Once released, another waiting caller may become the next leader. Waiting for leadership is abortable by disposing the returned handle.