title: Why does Future::select choose the future with a longer sleep period first?
body: <p>I'm trying to understand <a href="https://docs.rs/futures/0.1.18/futures/future/trait.Future.html#method.select" rel="noreferrer"><code>Future::select</code></a>: in this example, the future with a longer time delay is returned first.</p>
  
  <p>When I read <a href="https://dev.to/mindflavor/rust-futures-an-uneducated-short-and-hopefully-not-boring-tutorial---part-3---the-reactor-433" rel="noreferrer">this article</a> with its example, I get cognitive dissonance. The author writes:</p>
  
  <blockquote>
    <p>The <code>select</code> function runs two (or more in case of <code>select_all</code>) futures and returns the first one coming to completion. This is useful for implementing timeouts.</p>
  </blockquote>
  
  <p>It seems I don't understand the sense of <code>select</code>.</p>
  
  <pre><code>extern crate futures; // v0.1 (old)
  extern crate tokio_core;
  
  use std::thread;
  use std::time::Duration;
  use futures::{Async, Future};
  use tokio_core::reactor::Core;
  
  struct Timeout {
      time: u32,
  }
  
  impl Timeout {
      fn new(period: u32) -&gt; Timeout {
          Timeout { time: period }
      }
  }
  
  impl Future for Timeout {
      type Item = u32;
      type Error = String;
  
      fn poll(&amp;mut self) -&gt; Result&lt;Async&lt;u32&gt;, Self::Error&gt; {
          thread::sleep(Duration::from_secs(self.time as u64));
          println!("Timeout is done with time {}.", self.time);
          Ok(Async::Ready(self.time))
      }
  }
  
  fn main() {
      let mut reactor = Core::new().unwrap();
  
      let time_out1 = Timeout::new(5);
      let time_out2 = Timeout::new(1);
  
      let task = time_out1.select(time_out2);
  
      let mut reactor = Core::new().unwrap();
      reactor.run(task);
  }
  </code></pre>
  
  <p>I need to process the early future with the smaller time delay, and then work with the future with a longer delay. How can I do it?</p>