mirror of
https://github.com/bluenviron/mediamtx
synced 2025-01-25 00:13:54 +00:00
26 lines
336 B
Go
26 lines
336 B
Go
|
package core
|
||
|
|
||
|
import (
|
||
|
"sync"
|
||
|
|
||
|
"github.com/gin-gonic/gin"
|
||
|
)
|
||
|
|
||
|
type httpRequestPool struct {
|
||
|
wg sync.WaitGroup
|
||
|
}
|
||
|
|
||
|
func newHTTPRequestPool() *httpRequestPool {
|
||
|
return &httpRequestPool{}
|
||
|
}
|
||
|
|
||
|
func (rp *httpRequestPool) mw(ctx *gin.Context) {
|
||
|
rp.wg.Add(1)
|
||
|
ctx.Next()
|
||
|
rp.wg.Done()
|
||
|
}
|
||
|
|
||
|
func (rp *httpRequestPool) close() {
|
||
|
rp.wg.Wait()
|
||
|
}
|