Skip to content
Search

Scala:Future

lastmod 2020-08-27created 2020-08-272 edits

Global ExecutionContext

Just add the following.

import ExecutionContext.Implicits.global

Example

object FuturesComputation extends App {
  import scala.concurrent._
  import ExecutionContext.Implicits.global

  Future {
    log(s"the future is here")
  }

  log(s"the future is coming")
}

See also

Favorite site

author Zer0 sitemap