Skip to content

Commit

Permalink
Merge pull request #255 from mtojek/master
Browse files Browse the repository at this point in the history
Put acquired resources back to compressor pool
  • Loading branch information
emicklei committed Nov 18, 2015
2 parents b38cb13 + bf0f59b commit 362c6e6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compressor_pools.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,23 @@ func (s *SyncPoolCompessors) AcquireGzipWriter() *gzip.Writer {
}

func (s *SyncPoolCompessors) ReleaseGzipWriter(w *gzip.Writer) {
s.GzipWriterPool.Put(w)
}

func (s *SyncPoolCompessors) AcquireGzipReader() *gzip.Reader {
return s.GzipReaderPool.Get().(*gzip.Reader)
}

func (s *SyncPoolCompessors) ReleaseGzipReader(r *gzip.Reader) {
s.GzipReaderPool.Put(r)
}

func (s *SyncPoolCompessors) AcquireZlibWriter() *zlib.Writer {
return s.ZlibWriterPool.Get().(*zlib.Writer)
}

func (s *SyncPoolCompessors) ReleaseZlibWriter(w *zlib.Writer) {
s.ZlibWriterPool.Put(w)
}

func newGzipWriter() *gzip.Writer {
Expand Down

0 comments on commit 362c6e6

Please sign in to comment.