0.2.0
AHC 2.0 and (experimental) Akka HTTP backend
Gigahorse 0.2.0 abstracts over two HTTP backends.
@alexdupre contributed migration from AHC 1.9 to AHC 2.0, which is based on Netty 4 in #12.
There's now also an experimental Akka HTTP support. #15 by @eed3si9n
WebSocket support
@alexdupre also contributed WebSocket support.
Async processing with Reactive Stream
Thanks to Lightbend implementing Reactive Stream on both Akka HTTP and AHC #963, Gigahorse can abstract over both backends as Reactive Stream of byte or String stream.
The stream processing is provided using http.runStream(r, f)
.
import gigahorse._, support.akkahttp.Gigahorse
import scala.concurrent._, duration._
Gigahorse.withHttp(Gigahorse.config) { http =>
val r = Gigahorse.url("http://localhost:8000/README.markdown").get
val f = http.runStream(r, Gigahorse.asStringStream andThen { xs =>
xs.foreach { s => println(s) }
})
Await.result(f, 120.seconds)
}