mirror of
https://github.com/dkam/suo.git
synced 2025-01-29 07:42:43 +00:00
update docs for new options
This commit is contained in:
16
README.md
16
README.md
@@ -72,6 +72,22 @@ suo.lock do |token|
|
|||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Time To Live
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
Suo::Client::Redis.new("bar_resource", ttl: 10) #ttl in seconds
|
||||||
|
```
|
||||||
|
|
||||||
|
All locks are expired and the lock key is removed after the specified `ttl` time runs out. This would be the time since any resource for a given key was locked or unlocked.
|
||||||
|
|
||||||
|
### Lock Release Removes Key
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
Suo::Client::Redis.new("bar_resource", lock_release_removes_key: true)
|
||||||
|
```
|
||||||
|
|
||||||
|
Normally, a key representing a set of resource locks is persisted indefinitely even when no resources are currently locked. When `lock_release_removes_key` is set to `true`, the key is removed when the last resource lock is released. This also means that when another lock is acquired the key has to be recreated.
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
- more race condition tests
|
- more race condition tests
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user