-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace AsyncHttpClient with Ember #121
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ ThisBuild / githubWorkflowBuildPreamble += | |
List("decryptSecret gcs/src/test/resources/bad-auth-file.json.enc"), | ||
name = Some("Decrypt bad gcp service account json key")) | ||
|
||
val AwsSdkVersion = "2.15.34" | ||
val AwsSdkVersion = "2.16.21" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to be bumped because of netty version change, right? Needs to be done in other libs using the aws sdk as well. And I think something similar needs to happen for azure as well because they also use netty. It can be quite a pain to get all of the netty versions line up across all libs. Depending on how far we are with this, it may be easier to roll back https://github.com/precog/quasar-datasource-url/pull/763 et al and publish our own fix directly on top of http4s There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, we came to the same conclusion and are giving that a go. |
||
val Fs2Version = "2.5.6" | ||
val MonixVersion = "3.4.0" | ||
val SpecsVersion = "4.10.6" | ||
|
@@ -72,7 +72,6 @@ lazy val azure = project | |
libraryDependencies ++= Seq( | ||
"com.azure" % "azure-storage-blob" % "12.9.0", | ||
"com.azure" % "azure-identity" % "1.2.0", | ||
"io.projectreactor" %% "reactor-scala-extensions" % "0.6.0", | ||
"com.codecommit" %% "cats-effect-testing-specs2" % "0.4.1" % Test)) | ||
|
||
lazy val gcs = project | ||
|
@@ -89,6 +88,5 @@ lazy val gcs = project | |
"io.argonaut" %% "argonaut" % ArgonautVersion, | ||
"org.apache.logging.log4j" % "log4j-core" % Log4jVersion % Test, | ||
"org.apache.logging.log4j" % "log4j-slf4j-impl" % Log4jVersion % Test, | ||
"org.http4s" %% "http4s-async-http-client" % Http4sVersion, | ||
"org.http4s" %% "http4s-argonaut" % Http4sVersion, | ||
"com.github.markusbernhardt" % "proxy-vole" % "1.0.5")) | ||
"org.http4s" %% "http4s-ember-client" % Http4sVersion, | ||
"org.http4s" %% "http4s-argonaut" % Http4sVersion)) |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright 2020 Precog Data | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package quasar.blobstore.gcs | ||
|
||
import scala.concurrent.duration.Duration | ||
|
||
import cats.effect.{ConcurrentEffect, ContextShift, Resource, Timer} | ||
|
||
import org.http4s.client.Client | ||
import org.http4s.ember.client.EmberClientBuilder | ||
|
||
import org.slf4s.Logging | ||
|
||
object EmberHttpClientBuilder extends Logging { | ||
def apply[F[_]: ConcurrentEffect: ContextShift: Timer]: Resource[F, Client[F]] = | ||
EmberClientBuilder | ||
.default[F] | ||
.withMaxTotal(400) | ||
.withMaxPerKey(_ => 200) // the underlying pool is keyed by (scheme, host). i.e connection limit per host | ||
.withTimeout(Duration.Inf) | ||
.withMaxResponseHeaderSize(262144) | ||
.withIdleConnectionTime(Duration.Inf) | ||
.build | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably the most significant change. We used to use this to convert, but it looks obsolete given that Scala has supported Java lambdas since 2016. It was also bringing in ancient versions of
reactor-netty
(the source of this stack trace)This appeared to be the most straightforward way to convert
Mono
s toIO
, givenMono
s are also publishers.