Locker represents a distributed lock using Redis. The lock is identified by a unique key and value, where the value is used to ensure that only the lock holder can release or renew the lock.
| 49 | // The lock is identified by a unique key and value, where the value is used |
| 50 | // to ensure that only the lock holder can release or renew the lock. |
| 51 | type Locker struct { |
| 52 | client redis.UniversalClient // Redis client for interacting with Redis. |
| 53 | key string // The unique key for the lock in Redis. |
| 54 | value string // A unique value to ensure only the holder can release/extend the lock. |
| 55 | } |
| 56 | |
| 57 | // MultiLocker manages multiple distributed locks with deterministic ordering. |
| 58 | // It acquires locks in lexicographic order to prevent deadlocks when multiple |
nothing calls this directly
no outgoing calls
no test coverage detected