> 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?

Reply via email to