title: How to implement asynchronous queue?
body: <p>Given following variation of queue:</p>
  
  <pre><code>interface AsyncQueue&lt;T&gt; {
      //add new element to the queue
      void add(T elem); 
      //request single element from the queue via callback
      //callback will be called once for single polled element when it is available
      //so, to request multiple elements, poll() must be called multiple times with (possibly) different callbacks
      void poll(Consumer&lt;T&gt; callback);
  }
  </code></pre>
  
  <p>I found out i do not know how to implement it using java.util.concurrent primitives! So questions are:</p>
  
  <ul>
  <li>What is the right way to implement it using java.util.concurrent package?</li>
  <li>Is it possible to do this w/o using additional thread pool?</li>
  </ul>