aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradamw <adam@warski.org>2018-02-08 21:03:37 +0100
committeradamw <adam@warski.org>2018-02-08 21:03:37 +0100
commit7178f4248121f06448eb6c1ead37521d94aed1e8 (patch)
treeced9e5d38aa0dd2c32cc0f53a6a369a8ad2f8482
parent0f7b6875d5efcca55e0c92940527d1e8142dc888 (diff)
downloadsttp-7178f4248121f06448eb6c1ead37521d94aed1e8.tar.gz
sttp-7178f4248121f06448eb6c1ead37521d94aed1e8.tar.bz2
sttp-7178f4248121f06448eb6c1ead37521d94aed1e8.zip
Update fs2-reactive-streams and monix
-rw-r--r--async-http-client-backend/fs2/src/main/scala/com/softwaremill/sttp/asynchttpclient/fs2/AsyncHttpClientFs2Backend.scala18
-rw-r--r--build.sbt8
-rw-r--r--tests/src/test/scala/com/softwaremill/sttp/streaming/AsyncHttpClientFs2StreamingTests.scala3
3 files changed, 10 insertions, 19 deletions
diff --git a/async-http-client-backend/fs2/src/main/scala/com/softwaremill/sttp/asynchttpclient/fs2/AsyncHttpClientFs2Backend.scala b/async-http-client-backend/fs2/src/main/scala/com/softwaremill/sttp/asynchttpclient/fs2/AsyncHttpClientFs2Backend.scala
index 8343a9b..4c6dc71 100644
--- a/async-http-client-backend/fs2/src/main/scala/com/softwaremill/sttp/asynchttpclient/fs2/AsyncHttpClientFs2Backend.scala
+++ b/async-http-client-backend/fs2/src/main/scala/com/softwaremill/sttp/asynchttpclient/fs2/AsyncHttpClientFs2Backend.scala
@@ -4,21 +4,10 @@ import java.nio.ByteBuffer
import cats.effect._
import com.softwaremill.sttp.asynchttpclient.AsyncHttpClientBackend
-import com.softwaremill.sttp.{
- FollowRedirectsBackend,
- MonadAsyncError,
- SttpBackend,
- SttpBackendOptions,
- Utf8,
- concatByteBuffers
-}
+import com.softwaremill.sttp.{FollowRedirectsBackend, MonadAsyncError, SttpBackend, SttpBackendOptions, Utf8, concatByteBuffers}
import fs2._
import fs2.interop.reactivestreams._
-import org.asynchttpclient.{
- AsyncHttpClient,
- AsyncHttpClientConfig,
- DefaultAsyncHttpClient
-}
+import org.asynchttpclient.{AsyncHttpClient, AsyncHttpClientConfig, DefaultAsyncHttpClient}
import org.reactivestreams.Publisher
import scala.concurrent.ExecutionContext
@@ -45,7 +34,8 @@ class AsyncHttpClientFs2Backend[F[_]: Effect] private (
p: Publisher[ByteBuffer]): F[String] = {
val bytes = p
.toStream[F]
- .runFold(ByteBuffer.allocate(0))(concatByteBuffers)
+ .compile
+ .fold(ByteBuffer.allocate(0))(concatByteBuffers)
implicitly[Effect[F]].map(bytes)(bb => new String(bb.array(), Utf8))
}
diff --git a/build.sbt b/build.sbt
index 64f54d7..497bcfb 100644
--- a/build.sbt
+++ b/build.sbt
@@ -36,12 +36,12 @@ val commonSettings = Seq(
val akkaHttpVersion = "10.0.11"
val akkaHttp = "com.typesafe.akka" %% "akka-http" % akkaHttpVersion
-val monixVersion = "2.3.2"
+val monixVersion = "2.3.3"
val monix = "io.monix" %% "monix" % monixVersion
val circeVersion = "0.9.1"
-val scalaTest = "org.scalatest" %% "scalatest" % "3.0.4"
+val scalaTest = "org.scalatest" %% "scalatest" % "3.0.5"
lazy val rootProject = (project in file("."))
.settings(commonSettings: _*)
@@ -104,7 +104,7 @@ lazy val asyncHttpClientScalazBackend: Project = (project in file(
.settings(
name := "async-http-client-backend-scalaz",
libraryDependencies ++= Seq(
- "org.scalaz" %% "scalaz-concurrent" % "7.2.18"
+ "org.scalaz" %% "scalaz-concurrent" % "7.2.19"
)
) dependsOn asyncHttpClientBackend
@@ -132,7 +132,7 @@ lazy val asyncHttpClientFs2Backend: Project = (project in file(
.settings(
name := "async-http-client-backend-fs2",
libraryDependencies ++= Seq(
- "com.github.zainab-ali" %% "fs2-reactive-streams" % "0.2.7"
+ "com.github.zainab-ali" %% "fs2-reactive-streams" % "0.5.0"
)
) dependsOn asyncHttpClientBackend
diff --git a/tests/src/test/scala/com/softwaremill/sttp/streaming/AsyncHttpClientFs2StreamingTests.scala b/tests/src/test/scala/com/softwaremill/sttp/streaming/AsyncHttpClientFs2StreamingTests.scala
index 735a5c3..ec6ce05 100644
--- a/tests/src/test/scala/com/softwaremill/sttp/streaming/AsyncHttpClientFs2StreamingTests.scala
+++ b/tests/src/test/scala/com/softwaremill/sttp/streaming/AsyncHttpClientFs2StreamingTests.scala
@@ -24,6 +24,7 @@ class AsyncHttpClientFs2StreamingTests
stream
.map(bb => Chunk.array(bb.array))
.through(text.utf8DecodeC)
- .runFoldMonoid
+ .compile
+ .foldMonoid
}