David S.
David S.

Reputation: 11178

Up to date async http client for Scala?

I think dispatch was the preferred one a few years ago. But it seems this project has been idle for a while and have some out standing bugs left. I am wondering if the Scala community has moved on to some other async http client tool.

Akka has also released its akka-http-core. But bootstrapping a Actor system just for an async. client is too much, in my opinion. (Maybe it is not?)

Upvotes: 0

Views: 3399

Answers (2)

mgosk
mgosk

Reputation: 1876

You are right dispath is not maintained. You should choose from:

The choice isn't so easy, but you generally should avoiding multiplying libraries. If you already have any of them in classpath just use it.

Upvotes: 1

flavian
flavian

Reputation: 28511

The following libraries still pre-bundle a client:

finagle-http: Finagle is an extensible RPC system for the JVM, used to construct high-concurrency servers. Finagle implements uniform client and server APIs for several protocols, and is designed for high performance and concurrency. Most of Finagle’s code is protocol agnostic, simplifying the implementation of new protocols. Here's a sample HTTP client.

reboot: Dispatch reboot is a rewrite of the Dispatch library for HTTP interaction in Scala, using async-http-client as its underlying transport.

Implementation

In practice I would very strongly recommend that you look at what you already have in the classpath. Truthfully all of these dependencies are pretty huge and they may use very different underlying async HTTP libraries in Java to implement on top of, which may well lead to you bringing in huge dependencies for very little benefit.

Twitter is a fairly isolated corner of the eco-system, their libraries are brilliant but finagle-http will use Twitter Futures alongside a set of completely different concurrency primitives and so on.

Best advice I can give you is if you use Akka already in your project, just go for akka-http-core, if you use play go for play-ws and so on.

Upvotes: 2

Related Questions