diff options
author | Adam Warski <adam@warski.org> | 2017-08-04 11:58:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-04 11:58:29 +0200 |
commit | ab566fd5cf0f54e8e69b2917b32e57f2321d49ee (patch) | |
tree | daf39b33bf972d5b538f85eb202367920121cf4a /README.md | |
parent | dbec6b509e89f21628dc90fd8a2ed8d299135b24 (diff) | |
parent | 5ce4a596d49e7da42b8a60d438094f3ba67ab3f5 (diff) | |
download | sttp-ab566fd5cf0f54e8e69b2917b32e57f2321d49ee.tar.gz sttp-ab566fd5cf0f54e8e69b2917b32e57f2321d49ee.tar.bz2 sttp-ab566fd5cf0f54e8e69b2917b32e57f2321d49ee.zip |
Merge pull request #21 from aeons/feature/cats-effect
Add support for cats effect with AHC backend
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -188,6 +188,7 @@ uri"$scheme://$subdomains.example.com?x=$vx&$params#$jumpTo" | `FutureAsyncHttpClientHandler` | `scala.concurrent.Future` | - | | `ScalazAsyncHttpClientHandler` | `scalaz.concurrent.Task` | - | | `MonixAsyncHttpClientHandler` | `monix.eval.Task` | `monix.reactive.Observable[ByteBuffer]` | +| `CatsAsyncHttpClientHandler` | `F[_]: cats.effect.Async` | - | | `OkHttpSyncClientHandler` | None (`Id`) | - | | `OkHttpFutureClientHandler` | `scala.concurrent.Future` | - | @@ -271,6 +272,8 @@ To use, add the following dependency to your project: "com.softwaremill.sttp" %% "async-http-client-handler-scalaz" % "0.0.4" // or "com.softwaremill.sttp" %% "async-http-client-handler-monix" % "0.0.4" +// or +"com.softwaremill.sttp" %% "async-http-client-handler-cats" % "0.0.4" ``` This handler depends on [async-http-client](https://github.com/AsyncHttpClient/async-http-client). @@ -284,6 +287,8 @@ The responses are wrapped depending on the dependency chosen in either a: dependency on `scalaz-concurrent`. * [Monix](https://monix.io) `Task`. There's a transitive dependency on `monix-eval`. +* Any type implementing the [Cats Effect](https://github.com/typelevel/cats-effect) `Async` +typeclass, such as `cats.effect.IO`. There's a transitive dependency on `cats-effect`. Next you'll need to add an implicit value: @@ -296,6 +301,9 @@ implicit val sttpHandler = ScalazAsyncHttpClientHandler() // or, if you're using the monix version: implicit val sttpHandler = MonixAsyncHttpClientHandler() +// or, if you're using the cats effect version: +implicit val sttpHandler = CatsAsyncHttpClientHandler[cats.effect.IO]() + // or, if you'd like to use custom configuration: implicit val sttpHandler = FutureAsyncHttpClientHandler.usingConfig(asyncHttpClientConfig) @@ -433,4 +441,5 @@ and pick a task you'd like to work on! * [Tomasz Szymański](https://github.com/szimano) * [Adam Warski](https://github.com/adamw) -* [Omar Alejandro Mainegra Sarduy](https://github.com/omainegra)
\ No newline at end of file +* [Omar Alejandro Mainegra Sarduy](https://github.com/omainegra) +* [Bjørn Madsen](https://github.com/aeons) |