MultiLocker manages multiple distributed locks with deterministic ordering. It acquires locks in lexicographic order to prevent deadlocks when multiple transactions need to lock the same set of keys in different orders.
| 58 | // It acquires locks in lexicographic order to prevent deadlocks when multiple |
| 59 | // transactions need to lock the same set of keys in different orders. |
| 60 | type MultiLocker struct { |
| 61 | client redis.UniversalClient |
| 62 | lockers []*Locker |
| 63 | keys []string |
| 64 | value string |
| 65 | } |
| 66 | |
| 67 | // NewLocker initializes a new Locker instance with a Redis client, a key, and a value. |
| 68 | // Parameters: |
nothing calls this directly
no outgoing calls
no test coverage detected