Files
EdgeNode/internal/compressions/writer_pool_zstd.go

22 lines
402 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-06-27 22:40:36 +08:00
package compressions
import (
"io"
2024-07-27 15:42:50 +08:00
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
2022-06-27 22:40:36 +08:00
)
var sharedZSTDWriterPool *WriterPool
func init() {
if !teaconst.IsMain {
2022-07-26 09:41:43 +08:00
return
}
sharedZSTDWriterPool = NewWriterPool(CalculatePoolSize(), func(writer io.Writer, level int) (Writer, error) {
return newZSTDWriter(writer)
2022-06-27 22:40:36 +08:00
})
}