Created
November 18, 2015 16:21
-
-
Save johanandren/482f4244e72848d0ee88 to your computer and use it in GitHub Desktop.
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
import akka.actor.ActorSystem | |
import akka.http.scaladsl._ | |
import akka.http.scaladsl.model.{HttpMethods, Uri, HttpRequest} | |
import akka.stream.ActorMaterializer | |
import scala.concurrent.duration._ | |
import scala.concurrent.Await | |
object Bug18797 { | |
def main(args: Array[String]): Unit = { | |
implicit val system = ActorSystem("reproducer") | |
implicit val mat = ActorMaterializer() | |
import system.dispatcher | |
val uri = Uri("http://www.google.com") | |
val done = Http(system).singleRequest(HttpRequest(method = HttpMethods.GET, uri)).flatMap { response1 => | |
println("Got response 1") | |
Http(system).singleRequest(HttpRequest(method = HttpMethods.GET, uri)).map { response2 => | |
println("Got response 2") | |
} | |
} | |
Await.result(done, 30.seconds) | |
system.shutdown() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment