PriorityBlockingQueue
is unbounded, but I need to bound it somehow. What is the best way to achieve that?
For information, the bounded PriorityBlockingQueue
will be used in a ThreadPoolExecutor
.
NB: By bounded I don't want to throw Exception if that happens, I want to put the object in the queue and then cut it based on its priority value. Is there any good way to do this cut thingie?