// AddObject create an object using the PooledObjectFactory factory, passivate it, and then place it in
// the idle object pool. AddObject is useful for "pre-loading"
// a pool with idle objects. (Optional operation).
AddObject create an object using the PooledObjectFactory factory, passivate it, and then place it in
the idle object pool. AddObject is useful for "pre-loading"
a pool with idle objects. (Optional operation).
// AddObject create an object using the PooledObjectFactory factory passivate it and then place it in // the idle object pool . AddObject is useful for " pre - loading " // a pool with idle objects . ( Optional operation ) .
func (pool *ObjectPool) AddObject() error {
	if pool.IsClosed() {
		return NewIllegalStateErr("Pool not open")
	}
	if pool.factory == nil {
		return NewIllegalStateErr("Cannot add objects without a factory.")
	}
	p, e := pool.create()
	if e != nil {
		return e
	}
	pool.addIdleObject(p)
	return nil
}
func ( pool * ObjectPool ) AddObject ( ) error { if pool . IsClosed ( ) { return NewIllegalStateErr ( " " ) } if pool . factory == nil { return NewIllegalStateErr ( " " ) } p , e := pool . create ( ) if e != nil { return e } pool . addIdleObject ( p ) return nil }
AddObject create an object using the PooledObjectFactory factory, passivate it, and then place it in
the idle object pool.
AddObject create an object using the PooledObjectFactory factory passivate it and then place it in the idle object pool .