All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pl.touk.nussknacker.http.backend.HttpBackendProvider.scala Maven / Gradle / Ivy

The newest version!
package pl.touk.nussknacker.http.backend

import org.asynchttpclient.AsyncHttpClient
import pl.touk.nussknacker.engine.api.Lifecycle
import sttp.client3.SttpBackend
import sttp.client3.asynchttpclient.future.AsyncHttpClientFutureBackend

import scala.concurrent.{ExecutionContext, Future}

trait HttpBackendProvider extends Lifecycle {

  def httpBackendForEc(implicit ec: ExecutionContext): SttpBackend[Future, Any]

}

class FixedAsyncHttpClientBackendProvider(httpClient: AsyncHttpClient) extends HttpBackendProvider {

  override def httpBackendForEc(implicit ec: ExecutionContext): SttpBackend[Future, Any] =
    AsyncHttpClientFutureBackend.usingClient(httpClient)

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy