MCPcopy
hub / github.com/tinode/chat / Schedule

Method Schedule

server/concurrency/goroutinepool.go:29–35  ·  view source on GitHub ↗

Schedule enqueus a closure to run on the GoRoutinePool's goroutines.

(task Task)

Source from the content-addressed store, hash-verified

27
28// Schedule enqueus a closure to run on the GoRoutinePool's goroutines.
29func (p *GoRoutinePool) Schedule(task Task) {
30 select {
31 case p.work <- task:
32 case p.sem <- struct{}{}:
33 go p.worker(task)
34 }
35}
36
37// Stop sends a stop signal to all running goroutines.
38func (p *GoRoutinePool) Stop() {

Callers 1

Calls 1

workerMethod · 0.95

Tested by

no test coverage detected