Future.traverse seems to work sequentially and not in parallel. Is this true?
<p>My question is simple, about Future.traverse method.
So I have a list of String-s. Each string is an URL to a web page. Then I have a class which can take an URL, load the web page and parse some data. All this is wrapped into Future{} so the result is processed asynchronously.</p>

<p>The class is simplified looking like this:</p>

<pre><code>class RatingRetriever(context:ExecutionContext) {
  def resolveFilmToRating(url:String):Future[Option[Double]]={
    Future{
      //here it creates Selenium web driver, loads the url and parses it.
    }(context)
  }
}
</code></pre>

<p>Then in the other object I have this:</p>

<pre><code>    implicit val executionContext = ExecutionContext.fromExecutor(Executors.newFixedThreadPool(2))
    .......
    val links:List[String] = films.map(film =&gt; film.asInstanceOf[WebElement].getAttribute("href"))
    val ratings: Future[List[Option[Double]]] = Future.traverse(links)(link =&gt; new RatingRetriever(executionContext).resolveFilmToRating(link))
</code></pre>

<p>When it works I can definitely see it goes through collection sequentially. If I change the execution context from fixed size pool to single thread pool the behavior is the same.
So I really wonder how can I make the Future.traverse work in parallel. Can you advise?</p>