We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scala> :paste // Entering paste mode (ctrl-D to finish) import java.util.concurrent.{ExecutorService, Executors} import scala.concurrent.duration.Duration import scala.concurrent.{Await, ExecutionContext, ExecutionContextExecutor, Future} import scala.util.{Failure, Success} val pool: ExecutorService = Executors.newFixedThreadPool(10) implicit val ec: ExecutionContextExecutor = ExecutionContext.fromExecutorService(pool) def ff(i: Int): Future[Int] = Future{ println(i) Thread.sleep(i * 100) println(i) i } val futures: List[Future[Int]] = (1 to 10).map(i => ff(i)).toList val f = Future.sequence(futures) andThen { case Success(_) => println("All OK") } println("Before ready") Await.ready(f, Duration.Inf) println("After ready") pool.shutdown() // Exiting paste mode, now interpreting.
In scala 2.12 or 2.13 (with java 8) paste mode, it just print Before ready. But it works fine in 2.11 paste mode.
The text was updated successfully, but these errors were encountered:
almost certainly a duplicate of #9076
Sorry, something went wrong.
No branches or pull requests
In scala 2.12 or 2.13 (with java 8) paste mode, it just print Before ready.
But it works fine in 2.11 paste mode.
The text was updated successfully, but these errors were encountered: