Skip to content

Instantly share code, notes, and snippets.

@herberteuler
Created June 21, 2016 05:32
Show Gist options
  • Save herberteuler/f246e42da3252bd171e52156e71380c0 to your computer and use it in GitHub Desktop.
Save herberteuler/f246e42da3252bd171e52156e71380c0 to your computer and use it in GitHub Desktop.
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