title: Converting Future[SomeObject] into json
body: <p>I'm using scala and writing my domain objects to json. I use Play's Json Combinators like this:</p>
  
  <pre><code>implicit def opensHighlights: Writes[Option[OpensHighlights]] =
    (
      (__ \ 'header).write[String] and
      (__ \ 'topDeviceForOpens).write[String] and
      (__ \ 'percentage).write[String] and
      (__ \ 'percentageOf).write[String])(opensMaybe =&gt; {
        val header = Messages("email.summary.highlights.device.opens")
        val percentageOf = Messages("email.summary.highlights.ofAll.opens")
        opensMaybe match {
          case Some(opens) =&gt; (
            header,
            deviceTypeName(opens.topDevice),
            Percentage(opens.opensOnThisDevice, opens.totalOpens).stringValue(),
            percentageOf)
          case None =&gt; (header, NotApplicable, "0.00", percentageOf)
        }
      })
  </code></pre>
  
  <p>I'm using this writer in a larger writer:</p>
  
  <pre><code>implicit def summaryHighlightsWrites: Writes[SummaryHighlights] = {
        (
          (__ \ "google").write[Either[GoogleError, GoogleHighlights]] and
          (__ \ "dateWithHighestClickToOpenRate").write[Option[DateHighlights]] and
          (__ \ "subjectLine").write[Option[SubjectLineHighlights]] and
          (__ \ "location").write[Option[LocationHighlights]] and
          (__ \ "link").write[Option[LinkHighlights]] and
          (__ \ "deviceForOpens").write[Option[OpensHighlights]] and
          (__ \ "deviceForClicks").write[Option[ClicksHighlights]])(summary =&gt; {
            val result = for {
              google &lt;- summary.google
              dateRange &lt;- summary.dateRange
              subjectLine &lt;- summary.subjectLine
              location &lt;- summary.location
              link &lt;- summary.link
              opensDevice &lt;- summary.opensDevice
              clicksDevice &lt;- summary.clicksDevice
            } yield (google, dateRange, subjectLine, location, link, opensDevice, clicksDevice)
  
            Await.result(result, 10 seconds)
          })
      }
  </code></pre>
  
  <p>And here is the SummaryHighlights class:</p>
  
  <pre><code>case class SummaryHighlights(
    google: Future[Either[GoogleError, GoogleHighlights]],
    dateRange: Future[Option[DateHighlights]],
    subjectLine: Future[Option[SubjectLineHighlights]],
    location: Future[Option[LocationHighlights]],
    link: Future[Option[LinkHighlights]],
    opensDevice: Future[Option[OpensHighlights]],
    clicksDevice: Future[Option[ClicksHighlights]])
  </code></pre>
  
  <p>I need these fields to each be a <code>Future</code> because they have independent sources and can fail/succeed independently. </p>
  
  <p>I want to remove that explicit await. I want to move the await on the future from <code>summaryHighlightsWrites</code> to some other piece of code that calls this writer. Like a Play controller.</p>
  
  <p>Any help? Thanks</p>