title: What are the use cases of scala.concurrent.Promise?
body: <p>I am reading <a href="http://docs.scala-lang.org/sips/pending/futures-promises.html" rel="noreferrer">SIP-14</a> and the concept of <code>Future</code> makes perfect sense and easy to understand. But have two questions about <code>Promise</code>:</p>
  
  <ol>
  <li><p>The SIP says <code>Depending on the implementation, it may be the case that p.future == p</code>. How can this be? Are <code>Future</code> and <code>Promise</code> not two different types?</p></li>
  <li><p>When should we use a <code>Promise</code>? The example <code>producer and consumer</code> code :</p>
  
  <pre><code>import scala.concurrent.{ future, promise }
  val p = promise[T]
  val f = p.future
  
  val producer = future {
      val r = produceSomething()
      p success r
      continueDoingSomethingUnrelated()
  }
  val consumer = future {
      startDoingSomething()
      f onSuccess {
          case r =&gt; doSomethingWithResult()
      }
  }
  </code></pre></li>
  </ol>
  
  <p>is easy to read but do we really need to write like that? I tried to implement it only with Future and without Promise like this:</p>
  
  <pre><code>val f = future {
     produceSomething()
  }
  
  val producer = future {
     continueDoingSomethingUnrelated()
  }
  
  startDoingSomething()
  
  val consumer = future {
    f onSuccess {
      case r =&gt; doSomethingWithResult()
    }
  }
  </code></pre>
  
  <p>What is the difference between this and the given example and what makes a Promise necessary?</p>