Created
June 24, 2014 13:49
-
-
Save christophknabe/9592ee2ee632bc514fda to your computer and use it in GitHub Desktop.
Collecting ProductVersions of several servers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val uris = Seq( | |
"spray.io", "www.wikipedia.org" | |
//TODO Works well with only 2 URIs, sometimes also with 3 URIs, but does not scale to e.g. 5 URIs! | |
// , "scala-lang.org" | |
// , "doc.akka.io", "public.beuth-hochschule.de/~knabe/", "fb6.beuth-hochschule.de", "stackoverflow.com/questions/tagged/scala" | |
// , "esperanto.de", "tatoeba.org" | |
) | |
//The futures are constructed immediately one after another and are then running. | |
val futures = uris.map(requestProductVersion) | |
//Collect the results of all requests: | |
val result = Future.sequence(futures) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment