2022-06-27 22:40:36 +08:00
|
|
|
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
|
|
|
|
|
|
|
|
|
package compressions
|
|
|
|
|
|
|
|
|
|
import (
|
2022-07-26 09:41:43 +08:00
|
|
|
teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
|
2022-06-27 22:40:36 +08:00
|
|
|
"io"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var sharedZSTDWriterPool *WriterPool
|
|
|
|
|
|
|
|
|
|
func init() {
|
2023-03-10 15:14:14 +08:00
|
|
|
if !teaconst.IsMain {
|
2022-07-26 09:41:43 +08:00
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-17 08:36:14 +08:00
|
|
|
sharedZSTDWriterPool = NewWriterPool(CalculatePoolSize(), func(writer io.Writer, level int) (Writer, error) {
|
2024-04-16 11:32:38 +08:00
|
|
|
return newZSTDWriter(writer)
|
2022-06-27 22:40:36 +08:00
|
|
|
})
|
|
|
|
|
}
|