Created
June 21, 2016 05:32
-
-
Save herberteuler/f246e42da3252bd171e52156e71380c0 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
case class Foo(s: String, n: Int) | |
class MyClient(url: URL) extends featherbed.Client(url) { | |
override def clientTransform(client: Http.Client) = { | |
client.withSessionPool.maxSize(1) | |
} | |
} | |
val client = new MyClient(new URL("http://localhost:8766/api/")) | |
val req = client.post("foo/bar") | |
.withContent(Foo("hello, world", 42), "application/json") | |
.accept[Coproduct.`"application/json"`.T] | |
for (i <- 1 to 10000) { | |
val v = Await.result { req.send[Foo]() } | |
println(s"$i\t$v") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment