title: Is it possible to use Java 8 Streams API for asynchronous processing?
body: <p>I've been playing with CompletionStage/CompletableFuture in Java 8 in order to do asynchronous processing, which works quite well. However, sometimes I want a stage to perform asynchronous processing of an iterator/stream of items, and there doesn't seem to be a way to do this.</p>
  
  <p>Specifically, Stream.forEach() has the semantics that after the call all items have been processed. I would want the same thing, but with a CompletionStage instead, e.g.:</p>
  
  <pre><code>CompletionStage&lt;Void&gt; done = stream.forEach(...);
  done.thenRun(...);
  </code></pre>
  
  <p>If the Stream is backed by an asynchronous streaming result this would be much better than waiting for it to be complete in the above code itself.</p>
  
  <p>Is it possible to construct this with current Java 8 API somehow? Workarounds?</p>