WithValue can be used to assign the random value without having to call lock. This allows the ownership of a lock to be "transferred" and allows the lock to be unlocked from elsewhere.
(v string)
| 133 | // WithValue can be used to assign the random value without having to call lock. |
| 134 | // This allows the ownership of a lock to be "transferred" and allows the lock to be unlocked from elsewhere. |
| 135 | func WithValue(v string) Option { |
| 136 | return OptionFunc(func(m *Mutex) { |
| 137 | m.value = v |
| 138 | }) |
| 139 | } |
| 140 | |
| 141 | // WithFailFast can be used to quickly acquire and release the lock. |
| 142 | // When some Redis servers are blocking, we do not need to wait for responses from all the Redis servers response. |
searching dependent graphs…