diff --git a/README.md b/README.md index b12b2dc1..8bbf71b0 100644 --- a/README.md +++ b/README.md @@ -360,9 +360,9 @@ for (const lock of allLocks) { ### Acquire -`space.locks.acquire` initialises a lock request, adds it to the `locks` field of presence message extras, and calls `presence.update`. +`space.locks.acquire` sends a request to acquire a lock using presence. -It returns a Promise which resolves once `presence.update` resolves. +It returns a Promise which resolves once the presence request has been sent. ```javascript const req = await space.locks.acquire(id); @@ -377,9 +377,9 @@ It throws an error if a lock request already exists for the given identifier wit ### Release -`space.locks.release` releases a previously requested lock by removing it from the `locks` field of presence message extras, and calls `presence.update`. +`space.locks.release` releases a previously requested lock by removing it from presence. -It returns a Promise which resolves once `presence.update` resolves. +It returns a Promise which resolves once the presence request has been sent. ```javascript await space.locks.release(id); @@ -406,7 +406,7 @@ space.locks.subscribe('update', ({ member, request }) => { Such changes occur when: -- a `PENDING` request transitions to `LOCKED` (i.e. the requesting member now holds the lock) -- a `PENDING` request transitions to `UNLOCKED` (i.e. the requesting member does not hold the lock since another member already does) -- a `LOCKED` request transitions to `UNLOCKED` (i.e. the lock was either released or invalidated by a concurrent request which took precedence) -- an `UNLOCKED` request transitions to `LOCKED` (i.e. the requesting member reacquired a lock) +- a `PENDING` request transitions to `LOCKED` because the requesting member now holds the lock +- a `PENDING` request transitions to `UNLOCKED` because the requesting member does not hold the lock since another member already does +- a `LOCKED` request transitions to `UNLOCKED` because the lock was either released or invalidated by a concurrent request which took precedence +- an `UNLOCKED` request transitions to `LOCKED` because the requesting member reacquired a lock