aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAdam Warski <adam@warski.org>2017-08-04 11:58:29 +0200
committerGitHub <noreply@github.com>2017-08-04 11:58:29 +0200
commitab566fd5cf0f54e8e69b2917b32e57f2321d49ee (patch)
treedaf39b33bf972d5b538f85eb202367920121cf4a /README.md
parentdbec6b509e89f21628dc90fd8a2ed8d299135b24 (diff)
parent5ce4a596d49e7da42b8a60d438094f3ba67ab3f5 (diff)
downloadsttp-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.md11
1 files changed, 10 insertions, 1 deletions
diff --git a/README.md b/README.md
index bf4d4d2..358c6ea 100644
--- a/README.md
+++ b/README.md
@@ -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)