MCPcopy Create free account
hub / github.com/Shopify/goose / Wait

Method Wait

lockmap/map.go:48–62  ·  view source on GitHub ↗
(key interface{})

Source from the content-addressed store, hash-verified

46}
47
48func (m *lockMap) Wait(key interface{}) Promise {
49 now := time.Now().UnixNano()
50
51 m.l.RLock()
52 defer m.l.RUnlock()
53
54 if prev, ok := m.promises[key]; ok {
55 if prev.expiration > now {
56 return prev.promise
57 }
58 prev.resolve()
59 }
60
61 return nil
62}
63
64func (m *lockMap) WaitOrLock(key interface{}, ttl time.Duration) (promise Promise, gotLock bool) {
65 p := make(chan struct{})

Callers

nothing calls this directly

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected