MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / Locker

Struct Locker

internal/lock/lock.go:51–55  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
51type 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected