MCPcopy Create free account
hub / github.com/Monibuca/engine / Push

Method Push

track/data.go:78–92  ·  view source on GitHub ↗
(data T)

Source from the content-addressed store, hash-verified

76}
77
78func (dt *RecycleData[T]) Push(data T) {
79 if dt.Locker != nil {
80 dt.Lock()
81 defer dt.Unlock()
82 }
83 curValue := dt.Value
84 if log.Trace {
85 dt.Trace("push data", zap.Uint32("sequence", curValue.Sequence))
86 }
87 curValue.Data = data
88 dt.Step()
89 if !dt.Value.WriteTime.IsZero() {
90 dt.Value.Data.Recycle()
91 }
92}
93
94func NewRecycleDataTrack[T util.Recyclable](name string) (dt *RecycleData[T]) {
95 dt = &RecycleData[T]{}

Callers

nothing calls this directly

Calls 6

LockMethod · 0.80
UnlockMethod · 0.80
StepMethod · 0.80
TraceMethod · 0.65
RecycleMethod · 0.65
Uint32Method · 0.45

Tested by

no test coverage detected