MemoryLock coordinates access to idempotency keys using in-memory locks. MemoryLock is safe for concurrent use.
| 18 | // MemoryLock coordinates access to idempotency keys using in-memory locks. |
| 19 | // MemoryLock is safe for concurrent use. |
| 20 | type MemoryLock struct { |
| 21 | keys map[string]*countedLock |
| 22 | mu sync.Mutex |
| 23 | } |
| 24 | |
| 25 | // Lock acquires the lock for the provided key, creating it when necessary. |
| 26 | func (l *MemoryLock) Lock(key string) error { |
nothing calls this directly
no outgoing calls
no test coverage detected