MCPcopy Create free account
hub / github.com/erpc/erpc / counterInt64

Struct counterInt64

data/shared_state_variable.go:102–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102type counterInt64 struct {
103 baseSharedVariable
104 registry *sharedStateRegistry
105 key string
106 value atomic.Int64
107 updateMu sync.Mutex
108 valueCallbacks []func(int64)
109 ignoreRollbackOf int64
110 largeRollbackCallbacks []func(localVal, newVal int64)
111 callbackMu sync.RWMutex
112 // bgPushInProgress dedupes best-effort remote reconciliation/push operations.
113 // It MUST NOT be held while waiting on updateMu; remote sync should never block request flow.
114 bgPushInProgress sync.Mutex
115 // bgPushRequested indicates a newer value should be pushed after the current push attempt.
116 // This avoids dropping updates when scheduleBackgroundPushCurrent() is called while a push is in progress.
117 bgPushRequested atomic.Bool
118}
119
120func (c *counterInt64) GetValue() int64 {
121 return c.value.Load()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected