mirror of
https://github.com/bluenviron/mediamtx
synced 2024-12-27 09:02:12 +00:00
1617d07ba3
wait for them during shutdown.
21 lines
283 B
Go
21 lines
283 B
Go
package externalcmd
|
|
|
|
import (
|
|
"sync"
|
|
)
|
|
|
|
// Pool is a pool of external commands.
|
|
type Pool struct {
|
|
wg sync.WaitGroup
|
|
}
|
|
|
|
// NewPool allocates a Pool.
|
|
func NewPool() *Pool {
|
|
return &Pool{}
|
|
}
|
|
|
|
// Close waits for all external commands to exit.
|
|
func (p *Pool) Close() {
|
|
p.wg.Wait()
|
|
}
|