Skip to content

Commit

Permalink
upgrade to AHC 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
maiflai committed Aug 3, 2024
1 parent a2cfb0a commit 6635601
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description :=
"Core Dispatch module wrapping async-http-client"

libraryDependencies +=
"org.asynchttpclient" % "async-http-client" % "2.10.4"
"org.asynchttpclient" % "async-http-client" % "3.0.0"

enablePlugins(BuildInfoPlugin)

Expand Down
8 changes: 6 additions & 2 deletions core/src/main/scala/defaults.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import io.netty.util.{HashedWheelTimer, Timer}
import org.asynchttpclient.DefaultAsyncHttpClientConfig.Builder
import org.asynchttpclient._

import java.time.Duration

object Defaults {
implicit def executor = scala.concurrent.ExecutionContext.Implicits.global

Expand All @@ -26,9 +28,11 @@ private[dispatch] object InternalDefaults {
private object BasicDefaults extends Defaults {
lazy val timer = new HashedWheelTimer()

private val userAgent = "Dispatch/%s" format BuildInfo.version
private val infinite = Duration.ofMillis(-1)
def builder: Builder = new DefaultAsyncHttpClientConfig.Builder()
.setUserAgent("Dispatch/%s" format BuildInfo.version)
.setRequestTimeout(-1) // don't timeout streaming connections
.setUserAgent(userAgent)
.setRequestTimeout(infinite) // don't timeout streaming connections
.setUseProxyProperties(true)
}

Expand Down

0 comments on commit 6635601

Please sign in to comment.