Skip to content

Instantly share code, notes, and snippets.

@ramn
Last active February 19, 2016 09:21
Show Gist options
  • Save ramn/5020940 to your computer and use it in GitHub Desktop.
Save ramn/5020940 to your computer and use it in GitHub Desktop.
Futures with fixed thread pool
import java.util.concurrent.Executors
import concurrent.ExecutionContext
import concurrent.Future
import concurrent.Await
import scala.concurrent.duration._
implicit val executionContext = ExecutionContext.fromExecutorService(Executors.newFixedThreadPool(2))
Await.ready(Future { println("sdf") }, 3.seconds)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment