diff options
author | adamw <adam@warski.org> | 2018-03-21 19:01:02 -0400 |
---|---|---|
committer | adamw <adam@warski.org> | 2018-03-21 19:01:02 -0400 |
commit | d06c93b7691dec9b79e36c675440cfd28e93975c (patch) | |
tree | 5aaf420c913b1f25ce66cd07be6b904de8fdc748 /async-http-client-backend/monix | |
parent | 595b78eaf35673838697fe9ce8e6cf75bb2ac78b (diff) | |
download | sttp-d06c93b7691dec9b79e36c675440cfd28e93975c.tar.gz sttp-d06c93b7691dec9b79e36c675440cfd28e93975c.tar.bz2 sttp-d06c93b7691dec9b79e36c675440cfd28e93975c.zip |
Updating async-http-client
Diffstat (limited to 'async-http-client-backend/monix')
-rw-r--r-- | async-http-client-backend/monix/src/main/scala/com/softwaremill/sttp/asynchttpclient/monix/AsyncHttpClientMonixBackend.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/async-http-client-backend/monix/src/main/scala/com/softwaremill/sttp/asynchttpclient/monix/AsyncHttpClientMonixBackend.scala b/async-http-client-backend/monix/src/main/scala/com/softwaremill/sttp/asynchttpclient/monix/AsyncHttpClientMonixBackend.scala index 3d54b26..915b325 100644 --- a/async-http-client-backend/monix/src/main/scala/com/softwaremill/sttp/asynchttpclient/monix/AsyncHttpClientMonixBackend.scala +++ b/async-http-client-backend/monix/src/main/scala/com/softwaremill/sttp/asynchttpclient/monix/AsyncHttpClientMonixBackend.scala @@ -11,6 +11,7 @@ import com.softwaremill.sttp.{ Utf8, concatByteBuffers } +import io.netty.buffer.{ByteBuf, Unpooled} import monix.eval.Task import monix.execution.{Cancelable, Scheduler} import monix.reactive.Observable @@ -23,8 +24,8 @@ class AsyncHttpClientMonixBackend private (asyncHttpClient: AsyncHttpClient, clo implicit scheduler: Scheduler) extends AsyncHttpClientBackend[Task, Observable[ByteBuffer]](asyncHttpClient, TaskMonad, closeClient) { - override protected def streamBodyToPublisher(s: Observable[ByteBuffer]): Publisher[ByteBuffer] = - s.toReactivePublisher + override protected def streamBodyToPublisher(s: Observable[ByteBuffer]): Publisher[ByteBuf] = + s.map(Unpooled.wrappedBuffer).toReactivePublisher override protected def publisherToStreamBody(p: Publisher[ByteBuffer]): Observable[ByteBuffer] = Observable.fromReactivePublisher(p) |