Remove min size
Pruning pool functionality
This commit is contained in:
@@ -63,7 +63,6 @@ type Pool struct {
|
||||
allResources []*Resource
|
||||
availableResources []*Resource
|
||||
|
||||
minSize int
|
||||
maxSize int
|
||||
closed bool
|
||||
|
||||
@@ -108,25 +107,6 @@ func (p *Pool) Size() int {
|
||||
return n
|
||||
}
|
||||
|
||||
// MinSize returns the current minimum size of the pool.
|
||||
func (p *Pool) MinSize() int {
|
||||
p.cond.L.Lock()
|
||||
n := p.minSize
|
||||
p.cond.L.Unlock()
|
||||
return n
|
||||
}
|
||||
|
||||
// SetMinSize sets the minimum size of the pool. It panics if n < 0.
|
||||
func (p *Pool) SetMinSize(n int) {
|
||||
if n < 0 {
|
||||
panic("pool MinSize cannot be < 0")
|
||||
}
|
||||
p.cond.L.Lock()
|
||||
p.minSize = n
|
||||
|
||||
p.cond.L.Unlock()
|
||||
}
|
||||
|
||||
// MaxSize returns the current maximum size of the pool.
|
||||
func (p *Pool) MaxSize() int {
|
||||
p.cond.L.Lock()
|
||||
|
||||
Reference in New Issue
Block a user