func main() { completeChan := make(chan bool, 100) pool := objpool.NewTimedExiryPool(3000) for i := 0; i < 100; i++ { go ReuseFunc(pool, completeChan) } completeCount := 0 for { <-completeChan if completeCount++; completeCount == 100 { return } } }
// NewHttpHandler returns an *NewHttpHandler func NewHttpHandler(rsc *ServerResource, errorMappings []ErrorMapping) *HttpHandler { // FileAccessor handles null cache return &HttpHandler{FSHandler: *NewFSHandler(rsc, errorMappings, nil), BufferPool: objpool.NewTimedExiryPool(BufferExpiryTime)} }