Yep, you're right. It's not documented very well. I will make it so. I thought about doing this before, but I was afraid to mess up the serialization stuff. But, this should work quite well.
-----Original Message----- From: Stephen Colebourne [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 22, 2005 4:28 PM To: Jakarta Commons Developers List Subject: Re: [collections] BlockingBuffer and TimeoutBuffer I believe that 0 is what the JDK uses in Object.wait(long) for an infinite wait. A negative number would also mean infinite. Stephen James Carman wrote: > Stephen, > > I don't know about using 0 to indicate that it's a wait forever situation. > A negative number would be better for that, wouldn't you say? A 0 would > mean that you don't want to wait at all (of course, why would you use > BlockingBuffer if you're going to supply a 0). > > James > > -----Original Message----- > From: Stephen Colebourne [mailto:[EMAIL PROTECTED] > Sent: Monday, November 21, 2005 6:53 PM > To: Jakarta Commons Developers List > Subject: [collections] BlockingBuffer and TimeoutBuffer > > Having had a look at the new class TimeoutBuffer, I realised that it > could just be written as an extra parameter to BlockingBuffer. I think > this would be cleaner. > > BlockingBuffer.decorate(buf); // no timeout > BlockingBuffer.decorate(buf, timeout); // timeout > > The method implementation will simply check if the stored timeout value > is zero. If it is it does the get()/remove() as is, otherwise it uses > get(long)/remove(long). > > Note that adding a new field inn this case is OK with serialization as > the field will default to zero if an old version of the class is > deserialized using the new jar. > > Stephen > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]