README.md in redis-mutex-2.0.0 vs README.md in redis-mutex-2.1.0
- old
+ new
@@ -68,13 +68,14 @@
There are a number of methods:
```ruby
mutex = Redis::Mutex.new(key, options) # Configure a mutex lock
-mutex.lock # Try to acquire the lock
-mutex.unlock # Try to release the lock
+mutex.lock # Try to acquire the lock, returns false when failed
mutex.lock! # Try to acquire the lock, raises exception when failed
+mutex.unlock # Try to release the lock, returns false when failed
mutex.unlock! # Try to release the lock, raises exception when failed
+mutex.locked? # Find out if resource already locked
mutex.with_lock # Try to acquire the lock, execute the block, then return the value of the block.
# Raises exception when failed to acquire the lock.
Redis::Mutex.sweep # Remove all expired locks
Redis::Mutex.with_lock(key, options) # Shortcut to new + with_lock