If you have an ActorSystem , then it will have an ExecutionContext , which can be used here. It must be implicit unless you pass it explicitly to the Future.apply method.
To demonstrate, if you just want to see how this works in REPL:
implicit val system = ActorSystem("MySystem").dispatcher
(There is also an implicit conversion ActorSystem => ExecutionContext object.)
To create modular code without creating a context immediately before the point of use, consider making the context an abstract element of the attribute:
trait MyFutures { implicit val context: ExecutionContext def helloFuture: Future[String] = Future { "hello" + "world" } }
source share