golanggohlsrtmpwebrtcmedia-serverobs-studiortcprtmp-proxyrtmp-serverrtprtsprtsp-proxyrtsp-relayrtsp-serversrtstreamingwebrtc-proxy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
336 B
25 lines
336 B
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() |
|
}
|
|
|