diff options
Diffstat (limited to 'async-http-client-handler/monix')
-rw-r--r-- | async-http-client-handler/monix/src/main/scala/com/softwaremill/sttp/asynchttpclient/monix/MonixAsyncHttpClientHandler.scala | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/async-http-client-handler/monix/src/main/scala/com/softwaremill/sttp/asynchttpclient/monix/MonixAsyncHttpClientHandler.scala b/async-http-client-handler/monix/src/main/scala/com/softwaremill/sttp/asynchttpclient/monix/MonixAsyncHttpClientHandler.scala index 30106f2..fab9c98 100644 --- a/async-http-client-handler/monix/src/main/scala/com/softwaremill/sttp/asynchttpclient/monix/MonixAsyncHttpClientHandler.scala +++ b/async-http-client-handler/monix/src/main/scala/com/softwaremill/sttp/asynchttpclient/monix/MonixAsyncHttpClientHandler.scala @@ -21,6 +21,15 @@ class MonixAsyncHttpClientHandler(asyncHttpClient: AsyncHttpClient) def this(cfg: AsyncHttpClientConfig) = this(new DefaultAsyncHttpClient(cfg)) } +object MonixAsyncHttpClientHandler { + def apply(): MonixAsyncHttpClientHandler = + new MonixAsyncHttpClientHandler(new DefaultAsyncHttpClient()) + def usingConfig(cfg: AsyncHttpClientConfig): MonixAsyncHttpClientHandler = + new MonixAsyncHttpClientHandler(new DefaultAsyncHttpClient()) + def usingClient(client: AsyncHttpClient): MonixAsyncHttpClientHandler = + new MonixAsyncHttpClientHandler(client) +} + private[monix] object TaskMonad extends MonadAsyncError[Task] { override def unit[T](t: T): Task[T] = Task.now(t) |