commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sandy McArthur" <sandy...@apache.org>
Subject Re: [pool] Proposal: New Pool Impl -- GeneratorObjectPool
Date Sat, 01 Apr 2006 22:32:55 GMT
On 4/1/06, Peter Steijn <psteijn@gmail.com> wrote:
> > This should probably be changed. There is no reason addObject cannot
> > have the old blocking behavior and still have the generator behavior
> > for calls to borrowObject that need to create a new pooled object.
> >
> > This change will break code like:
> >
> > while (pool.getNumIdle() < 5) {
> >   pool.addObject();
> > }
> > by the time the getNumIdle returns 5 about 1000 objects will be
> > scheduled to be added to the pool.
>
>
> true, but I would still like to give the user the option to call a
> non-blocking addObject in case they want to use the functionality.
>
> Perhaps I should provide a function overloaded type where you can either
> call
> addObject()
> or
> addObject(boolean)  where boolean is a flag that sets whether the addObject
> should block or not?

That's fine, it's just the behavior of methods specified by ObjectPool
needs to be preserved.


--
Sandy McArthur

"He who dares not offend cannot be honest."
- Thomas Paine

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message