github.com/TeaOSLab/EdgeNode@v1.3.8/internal/compressions/reader_pool_zstd.go (about)

     1  // Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
     2  
     3  package compressions
     4  
     5  import (
     6  	teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
     7  	"io"
     8  )
     9  
    10  var sharedZSTDReaderPool *ReaderPool
    11  
    12  func init() {
    13  	if !teaconst.IsMain {
    14  		return
    15  	}
    16  
    17  	sharedZSTDReaderPool = NewReaderPool(CalculatePoolSize(), func(reader io.Reader) (Reader, error) {
    18  		return newZSTDReader(reader)
    19  	})
    20  }