You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by James Carman <ja...@carmanconsulting.com> on 2005/11/11 23:18:47 UTC
[collections] BoundedBuffer
I'm working on the BoundedBuffer implementation right now. But, I've got a
question for you folks. What do you think a reasonable default would be for
the timeout value? Should it wait forever by default (like TimeoutBuffer
does) or should it immediately throw a BufferOverflowException?
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
RE: [collections] BoundedBuffer
Posted by James Carman <ja...@carmanconsulting.com>.
That's the way I have it now. I thought that'd be more appropriate. The
TimeoutBuffer does the opposite, though. If someone's going to use a
TimeoutBuffer, then they will want to wait for some period of time.
Otherwise, they'd just use the enclosed Buffer which would throw a
BufferUnderflowException immediately.
-----Original Message-----
From: Sandy McArthur [mailto:sandymac@gmail.com]
Sent: Friday, November 11, 2005 6:12 PM
To: Jakarta Commons Developers List
Subject: Re: [collections] BoundedBuffer
On 11/11/05, James Carman <ja...@carmanconsulting.com> wrote:
> I'm working on the BoundedBuffer implementation right now. But, I've got
a
> question for you folks. What do you think a reasonable default would be
for
> the timeout value? Should it wait forever by default (like TimeoutBuffer
> does) or should it immediately throw a BufferOverflowException?
Unless the class is named something like WaitBuffer then it should
fail immediately by default. A programmer who isn't paying attention
would be confused why their program just seems to hang if the default
behavior was to block for a while.
--
Sandy McArthur
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: [collections] BoundedBuffer
Posted by Sandy McArthur <sa...@gmail.com>.
On 11/11/05, James Carman <ja...@carmanconsulting.com> wrote:
> I'm working on the BoundedBuffer implementation right now. But, I've got a
> question for you folks. What do you think a reasonable default would be for
> the timeout value? Should it wait forever by default (like TimeoutBuffer
> does) or should it immediately throw a BufferOverflowException?
Unless the class is named something like WaitBuffer then it should
fail immediately by default. A programmer who isn't paying attention
would be confused why their program just seems to hang if the default
behavior was to block for a while.
--
Sandy McArthur
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org