Files
rtsp-simple-server/internal/core/http_requestpool.go
2023-01-08 13:36:55 +01:00

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()
}