MCPcopy Create free account
hub / github.com/corestoreio/pkg / ShouldStart

Method ShouldStart

sync/suspend/state.go:114–125  ·  view source on GitHub ↗

ShouldStart reports true atomically for a specific uint64, if a process can start. Safe for concurrent use. You should check ShouldStart() first in your switch statement: switch { case hs.ShouldStart(scopeHash): // start here your process err := hs.Done(scopeHash) case hs.ShouldWait(

(key uint64)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 3

ShouldStartBytesMethod · 0.95
TestHashState_CanRunFunction · 0.95
TestHashState_ShouldWaitFunction · 0.95

Calls 3

InitializedMethod · 0.95
newRunningStateFunction · 0.85
LockMethod · 0.80

Tested by 2

TestHashState_CanRunFunction · 0.76
TestHashState_ShouldWaitFunction · 0.76