title: Keep main thread running while await classes haven't finished
body: <p>I have the following code:</p>
  
  <pre><code>  val f1: Future[Unit] = Future {
      Thread sleep 5
      println(1)
    }
  
    val f2: Future[Unit] = Future {
      Thread sleep 10000
      println(2)
    }
  
    def main(args: Array[String]): Unit = async {
      await(f1)
      await(f2)
   }
  </code></pre>
  
  <p>I would like the main thread to terminate after the last <code>await</code> method has terminated.</p>
  
  <p>How can I do that?</p>