Queue implementation with blocked 'take()' but with eviction policy

Posted by mjlee on Stack Overflow See other posts from Stack Overflow or by mjlee
Published on 2010-05-07T04:07:12Z Indexed on 2010/05/07 4:38 UTC
Read the original article Hit count: 158

Filed under:
|
|

Is there an implementation with a blocking queue for take but bounded by a maximum size. However, when the maximum size is reached, instead of blocking, it will remove from the head.

One usage is that if I have a very slow consumer, the system will not crash ( runs out of memory ) rather these message will be removed.

© Stack Overflow or respective owner

Related posts about java

Related posts about collections