github.com/TeaOSLab/EdgeNode@v1.3.8/internal/compressions/reader_pool_brotli.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 sharedBrotliReaderPool *ReaderPool 11 12 func init() { 13 if !teaconst.IsMain { 14 return 15 } 16 17 18 sharedBrotliReaderPool = NewReaderPool(CalculatePoolSize(), func(reader io.Reader) (Reader, error) { 19 return newBrotliReader(reader) 20 }) 21 }