MCPcopy
hub / github.com/livekit/livekit / Add

Method Add

pkg/sfu/utils/debounce.go:20–28  ·  view source on GitHub ↗
(f func())

Source from the content-addressed store, hash-verified

18}
19
20func (d *Debouncer) Add(f func()) {
21 d.mu.Lock()
22 defer d.mu.Unlock()
23
24 if d.timer != nil {
25 d.timer.Stop()
26 }
27 d.timer = time.AfterFunc(d.after, f)
28}
29
30func (d *Debouncer) SetDuration(after time.Duration) {
31 d.mu.Lock()

Callers 15

SendNodeRoomStatesMethod · 0.45
RecordTwirpRequestStatusFunction · 0.45
AddRefFunction · 0.45
IncrementPacketsFunction · 0.45
IncrementBytesFunction · 0.45
IncrementRTCPFunction · 0.45

Calls 1

StopMethod · 0.65

Tested by 15

TestRoomLockFunction · 0.36
TestEgressStoreFunction · 0.36
benchmarkPoolFunction · 0.36
benchmarkGoroutineFunction · 0.36
benchmarkLoadBalancedFunction · 0.36
TestBitrateCalculatorFunction · 0.36
TestDataChannelWriterFunction · 0.36
WriteMethod · 0.36
TestAudioLevelFunction · 0.36
observeSamplesFunction · 0.36