WithFailFast can be used to quickly acquire and release the lock. When some Redis servers are blocking, we do not need to wait for responses from all the Redis servers response. As long as the quorum is met, we can assume the lock is acquired. The effect of this parameter is to achieve low latency,
(b bool)
| 143 | // As long as the quorum is met, we can assume the lock is acquired. The effect of this parameter is to achieve low |
| 144 | // latency, avoid Redis blocking causing Lock/Unlock to not return for a long time. |
| 145 | func WithFailFast(b bool) Option { |
| 146 | return OptionFunc(func(m *Mutex) { |
| 147 | m.failFast = b |
| 148 | }) |
| 149 | } |
| 150 | |
| 151 | // WithShufflePools can be used to shuffle Redis pools to reduce centralized access in concurrent scenarios. |
| 152 | func WithShufflePools(b bool) Option { |
nothing calls this directly
no test coverage detected
searching dependent graphs…