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

Method Push

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

Source from the content-addressed store, hash-verified

21}
22
23func (dt *Data[T]) Push(data T) {
24 if dt.Locker != nil {
25 dt.Lock()
26 defer dt.Unlock()
27 }
28 curValue := dt.Value
29 if log.Trace {
30 dt.Trace("push data", zap.Uint32("sequence", curValue.Sequence))
31 }
32 curValue.Data = data
33 dt.Step()
34}
35
36func (d *Data[T]) Play(ctx context.Context, onData func(*DataFrame[T]) error) (err error) {
37 d.Debug("play data track")

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected