MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / NewHTTPClientPool

Function NewHTTPClientPool

internal/nodes/http_client_pool.go:38–49  ·  view source on GitHub ↗

NewHTTPClientPool 获取新对象

()

Source from the content-addressed store, hash-verified

36
37// NewHTTPClientPool 获取新对象
38func NewHTTPClientPool() *HTTPClientPool {
39 var pool = &HTTPClientPool{
40 cleanTicker: time.NewTicker(1 * time.Hour),
41 clientsMap: map[uint64]*HTTPClient{},
42 }
43
44 goman.New(func() {
45 pool.cleanClients()
46 })
47
48 return pool
49}
50
51// Client 根据地址获取客户端
52func (this *HTTPClientPool) Client(req *HTTPRequest,

Calls 2

NewFunction · 0.92
cleanClientsMethod · 0.80

Tested by 3