Files
EdgeNode/internal/compressions/writer_pool_deflate.go

22 lines
411 B
Go
Raw Normal View History

2024-05-17 18:30:33 +08:00
// Copyright 2022 GoEdge goedge.cdn@gmail.com. All rights reserved.
2022-03-20 00:05:47 +08:00
package compressions
import (
"io"
2024-07-27 15:42:50 +08:00
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
2022-03-20 00:05:47 +08:00
)
var sharedDeflateWriterPool *WriterPool
func init() {
if !teaconst.IsMain {
2022-07-26 09:41:43 +08:00
return
}
sharedDeflateWriterPool = NewWriterPool(CalculatePoolSize(), func(writer io.Writer, level int) (Writer, error) {
return newDeflateWriter(writer)
2022-03-20 00:05:47 +08:00
})
}