title: Python's `concurrent.futures`: Iterate on futures according to order of completion
body: <p>I want something similar to <code>executor.map</code>, except when I iterate over the results, I want to iterate over them according to the order of completion, e.g. the work item that was completed first should appear first in the iteration, etc. This is so the iteration will block iff every single work item in the sequence is not finished yet.</p>
  
  <p>I know how to implement this myself using queues, but I'm wondering whether it's possible using the <code>futures</code> framework.</p>
  
  <p>(I mostly used thread-based executors, so I'd like an answer that applies to these, but a general answer would be welcome as well.)</p>
  
  <p><strong>UPDATE</strong>: Thanks for the answers! Can you please explain how I can use <code>as_completed</code> with <code>executor.map</code>? <code>executor.map</code> is the most useful and succinct tool for me when using futures, and I'd be reluctant to start using <code>Future</code> objects manually.</p>