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

Struct MultiLocker

internal/lock/lock.go:60–65  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
60type 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:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected