Files
EdgeNode/internal/compressions/writer_pool_deflate.go

22 lines
456 B
Go
Raw Normal View History

2022-03-20 00:05:47 +08:00
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package compressions
import (
"compress/flate"
2022-07-26 09:41:43 +08:00
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
2022-03-20 00:05:47 +08:00
"io"
)
var sharedDeflateWriterPool *WriterPool
func init() {
if !teaconst.IsMain {
2022-07-26 09:41:43 +08:00
return
}
sharedDeflateWriterPool = NewWriterPool(CalculatePoolSize(), flate.BestCompression, func(writer io.Writer, level int) (Writer, error) {
return newDeflateWriter(writer)
2022-03-20 00:05:47 +08:00
})
}