diff --git a/README.md b/README.md index a899889..5fd0af1 100644 --- a/README.md +++ b/README.md @@ -70,9 +70,9 @@ await using (var redLock = await redlockFactory.CreateLockAsync(resource, expiry ### When you want to lock on a resource (blocking and retrying every `retry` seconds until the lock is available, or `wait` seconds have passed): ```csharp var resource = "the-thing-we-are-locking-on"; -var expiry = TimeSpan.FromSeconds(30); -var wait = TimeSpan.FromSeconds(10); -var retry = TimeSpan.FromSeconds(1); +var expiry = TimeSpan.FromSeconds(30); // The expiry time passed to the redis command +var wait = TimeSpan.FromSeconds(10); // Waiting time to acquire lock +var retry = TimeSpan.FromSeconds(1); // Waiting time before retrying to acquire lock // blocks until acquired or 'wait' timeout await using (var redLock = await redlockFactory.CreateLockAsync(resource, expiry, wait, retry)) // there are also non async Create() methods @@ -162,4 +162,4 @@ Since all operations that RedLock.net performs in Redis (Lock, Extend and Unlock There is the potential for a master to become inaccessible after acquiring a lock, but before that lock is propogated to the replicated slaves. If one of the slaves is then promoted to master, the lock will not have been acquired within Redis, and there is the possibility that another process could also acquire the lock, resulting in two processes running within the lock section at the same time. Running with multiple independent instances (or multiple independent replicated instances) should mitigate this somewhat, as the RedLock quorum is still required before another process can acquire the lock. -There is the potential for a master to become inaccessible after releasing a lock, but before the lock removal is propogated to the replicated slaves. This will result in the lock continuing to be held until the Redis key expires after the specified expiry time. \ No newline at end of file +There is the potential for a master to become inaccessible after releasing a lock, but before the lock removal is propogated to the replicated slaves. This will result in the lock continuing to be held until the Redis key expires after the specified expiry time.