Skip to content

Instantly share code, notes, and snippets.

@Krasnyanskiy
Last active July 24, 2016 16:25
Show Gist options
  • Save Krasnyanskiy/75971d3d59833ae48f83f1769b732bb2 to your computer and use it in GitHub Desktop.
Save Krasnyanskiy/75971d3d59833ae48f83f1769b732bb2 to your computer and use it in GitHub Desktop.
-scala: future
import java.util.concurrent.Executors.newFixedThreadPool
import scala.concurrent.ExecutionContext.fromExecutorService
import scala.concurrent.Future
/**
* @author Alexander Krasniansky
*/
object FutureSomeExample extends App {
val executor = newFixedThreadPool(8)
implicit val executionContext = fromExecutorService(executor)
for { Some(i) <- Future(Some(1)) } println(i)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment