aboutsummaryrefslogtreecommitdiff
path: root/async-http-client-backend/monix
diff options
context:
space:
mode:
authoradamw <adam@warski.org>2017-10-06 14:19:44 +0200
committeradamw <adam@warski.org>2017-10-06 14:19:44 +0200
commitbb7abc189d9a5f079caa47a4508b5ae585dc8bcf (patch)
tree4d096e1b0c78156df923a7cf3282a86507b8ef8b /async-http-client-backend/monix
parent43baccc0edf12e8951c903d6697d7ee24a201e63 (diff)
downloadsttp-bb7abc189d9a5f079caa47a4508b5ae585dc8bcf.tar.gz
sttp-bb7abc189d9a5f079caa47a4508b5ae585dc8bcf.tar.bz2
sttp-bb7abc189d9a5f079caa47a4508b5ae585dc8bcf.zip
#10: add proxy support
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.scala10
1 files changed, 4 insertions, 6 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 c08c244..9cb44f2 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
@@ -6,6 +6,7 @@ import com.softwaremill.sttp.{
FollowRedirectsBackend,
MonadAsyncError,
SttpBackend,
+ SttpBackendOptions,
Utf8,
concatByteBuffers
}
@@ -20,7 +21,6 @@ import org.asynchttpclient.{
}
import org.reactivestreams.Publisher
-import scala.concurrent.duration.FiniteDuration
import scala.util.{Failure, Success}
class AsyncHttpClientMonixBackend private (
@@ -62,13 +62,11 @@ object AsyncHttpClientMonixBackend {
* @param s The scheduler used for streaming request bodies. Defaults to the
* global scheduler.
*/
- def apply(connectionTimeout: FiniteDuration =
- SttpBackend.DefaultConnectionTimeout)(
+ def apply(options: SttpBackendOptions = SttpBackendOptions.Default)(
implicit s: Scheduler = Scheduler.Implicits.global)
: SttpBackend[Task, Observable[ByteBuffer]] =
- AsyncHttpClientMonixBackend(
- AsyncHttpClientBackend.defaultClient(connectionTimeout.toMillis.toInt),
- closeClient = true)
+ AsyncHttpClientMonixBackend(AsyncHttpClientBackend.defaultClient(options),
+ closeClient = true)
/**
* @param s The scheduler used for streaming request bodies. Defaults to the