MCPcopy Create free account
hub / github.com/pion/ice / runLoop

Method runLoop

internal/taskloop/taskloop.go:48–63  ·  view source on GitHub ↗

runLoop handles registered tasks and agent close.

(onClose func())

Source from the content-addressed store, hash-verified

46
47// runLoop handles registered tasks and agent close.
48func (l *Loop) runLoop(onClose func()) {
49 defer func() {
50 onClose()
51 close(l.taskLoopDone)
52 }()
53
54 for {
55 select {
56 case <-l.done:
57 return
58 case t := <-l.tasks:
59 t.fn(l)
60 close(t.done)
61 }
62 }
63}
64
65// Close stops the loop after finishing the execution of the current task.
66// Other pending tasks will not be executed.

Callers 1

NewFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected