2

I have seen few threads on how to simulate blocking peek, but my question is why is this method not provided by default?

I have seen many threads asking for this, but is there an obvious work around for blocking peek, or is it not advisable to rely on such approach ?

jay
  • 1,982
  • 2
  • 24
  • 54
  • 1
    What would be the point? All you're going to do when it returns is take something from the queue, surely? So why not block in `take()`? Where is the advantage? – user207421 Jul 25 '16 at 05:30
  • 3
    Sometimes you want to use the element while leaving it in the queue, for example if you're processing unique elements and want to make sure you don't process the same one twice. – Dor Mar 30 '17 at 07:30

0 Answers0