Function
NewWriterPool
(maxSize int, newFunc func(writer io.Writer, level int) (Writer, error))
Source from the content-addressed store, hash-verified
| 38 | } |
| 39 | |
| 40 | func NewWriterPool(maxSize int, newFunc func(writer io.Writer, level int) (Writer, error)) *WriterPool { |
| 41 | if maxSize <= 0 { |
| 42 | maxSize = 1024 |
| 43 | } |
| 44 | |
| 45 | return &WriterPool{ |
| 46 | c: make(chan Writer, maxSize), |
| 47 | newFunc: newFunc, |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | func (this *WriterPool) Get(parentWriter io.Writer, level int) (Writer, error) { |
| 52 | if isBusy { |
Tested by
no test coverage detected