commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <>
Subject RE: [collections] BlockingBuffer and TimeoutBuffer
Date Tue, 22 Nov 2005 15:09:37 GMT

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).


-----Original Message-----
From: Stephen Colebourne [] 
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 

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.


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message