From 6ad36ef5f6b2468f77e1b1770f3d2ef7db97137b Mon Sep 17 00:00:00 2001 From: "Ross A. Baker" Date: Wed, 4 Jan 2023 09:58:56 -0500 Subject: [PATCH 1/2] Update to http4s-server-1.0.0-M38 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 6fc932f07..bfce58f10 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ import Dependencies._ val Scala213 = "2.13.10" val Scala3 = "3.2.1" -val http4sVersion = "1.0.0-M37" +val http4sVersion = "1.0.0-M38" val munitCatsEffectVersion = "2.0.0-M3" ThisBuild / resolvers += From a23f7c5f2a2f05914ac3da9619ab4a9b22f7907b Mon Sep 17 00:00:00 2001 From: "Ross A. Baker" Date: Wed, 4 Jan 2023 10:33:49 -0500 Subject: [PATCH 2/2] Clean up deprecations --- .../scala/org/http4s/blaze/client/BlazeClientBuilder.scala | 2 +- .../test/scala/org/http4s/blaze/client/BlazeClientBase.scala | 2 +- .../scala/org/http4s/blaze/client/Http1ClientStageSuite.scala | 2 +- .../test/scala/org/http4s/blaze/client/PoolManagerSuite.scala | 1 - .../scala/org/http4s/blaze/core/DispatcherIOFixture.scala | 2 +- .../http4s/blaze/core/websocket/WebSocketHandshakeSuite.scala | 4 ++-- .../scala/org/http4s/blaze/server/BlazeServerBuilder.scala | 2 +- .../scala/org/http4s/blaze/server/Http1ServerStageSpec.scala | 2 +- 8 files changed, 8 insertions(+), 9 deletions(-) diff --git a/blaze-client/src/main/scala/org/http4s/blaze/client/BlazeClientBuilder.scala b/blaze-client/src/main/scala/org/http4s/blaze/client/BlazeClientBuilder.scala index 5f74dfdb3..c2c2075ad 100644 --- a/blaze-client/src/main/scala/org/http4s/blaze/client/BlazeClientBuilder.scala +++ b/blaze-client/src/main/scala/org/http4s/blaze/client/BlazeClientBuilder.scala @@ -287,7 +287,7 @@ final class BlazeClientBuilder[F[_]] private ( */ def resourceWithState: Resource[F, (Client[F], BlazeClientState[F])] = for { - dispatcher <- Dispatcher[F] + dispatcher <- Dispatcher.parallel[F] scheduler <- scheduler _ <- Resource.eval(verifyAllTimeoutsAccuracy(scheduler)) _ <- Resource.eval(verifyTimeoutRelations()) diff --git a/blaze-client/src/test/scala/org/http4s/blaze/client/BlazeClientBase.scala b/blaze-client/src/test/scala/org/http4s/blaze/client/BlazeClientBase.scala index a7cad4c06..3ed72ffec 100644 --- a/blaze-client/src/test/scala/org/http4s/blaze/client/BlazeClientBase.scala +++ b/blaze-client/src/test/scala/org/http4s/blaze/client/BlazeClientBase.scala @@ -81,7 +81,7 @@ trait BlazeClientBase extends CatsEffectSuite { private def makeScaffold(num: Int, secure: Boolean): Resource[IO, ServerScaffold[IO]] = for { - dispatcher <- Dispatcher[IO] + dispatcher <- Dispatcher.parallel[IO] getHandler <- Resource.eval( RoutesToHandlerAdapter( HttpRoutes.of[IO] { diff --git a/blaze-client/src/test/scala/org/http4s/blaze/client/Http1ClientStageSuite.scala b/blaze-client/src/test/scala/org/http4s/blaze/client/Http1ClientStageSuite.scala index a66da0ddd..7460ec45e 100644 --- a/blaze-client/src/test/scala/org/http4s/blaze/client/Http1ClientStageSuite.scala +++ b/blaze-client/src/test/scala/org/http4s/blaze/client/Http1ClientStageSuite.scala @@ -56,7 +56,7 @@ class Http1ClientStageSuite extends CatsEffectSuite with DispatcherIOFixture { private val fooConnection = ResourceFunFixture[Http1Connection[IO]] { for { - dispatcher <- Dispatcher[IO] + dispatcher <- Dispatcher.parallel[IO] connection <- mkConnection(FooRequestKey, dispatcher) } yield connection } diff --git a/blaze-client/src/test/scala/org/http4s/blaze/client/PoolManagerSuite.scala b/blaze-client/src/test/scala/org/http4s/blaze/client/PoolManagerSuite.scala index 7dd966a2c..5f04f0453 100644 --- a/blaze-client/src/test/scala/org/http4s/blaze/client/PoolManagerSuite.scala +++ b/blaze-client/src/test/scala/org/http4s/blaze/client/PoolManagerSuite.scala @@ -20,7 +20,6 @@ package client import cats.effect._ import cats.effect.std._ -import cats.implicits._ import com.comcast.ip4s._ import fs2.Stream import munit.CatsEffectSuite diff --git a/blaze-core/src/test/scala/org/http4s/blaze/core/DispatcherIOFixture.scala b/blaze-core/src/test/scala/org/http4s/blaze/core/DispatcherIOFixture.scala index 6f3a7e1fb..daaf612f0 100644 --- a/blaze-core/src/test/scala/org/http4s/blaze/core/DispatcherIOFixture.scala +++ b/blaze-core/src/test/scala/org/http4s/blaze/core/DispatcherIOFixture.scala @@ -23,6 +23,6 @@ import munit.CatsEffectSuite trait DispatcherIOFixture { this: CatsEffectSuite => - def dispatcher: SyncIO[FunFixture[Dispatcher[IO]]] = ResourceFunFixture(Dispatcher[IO]) + def dispatcher: SyncIO[FunFixture[Dispatcher[IO]]] = ResourceFunFixture(Dispatcher.parallel[IO]) } diff --git a/blaze-core/src/test/scala/org/http4s/blaze/core/websocket/WebSocketHandshakeSuite.scala b/blaze-core/src/test/scala/org/http4s/blaze/core/websocket/WebSocketHandshakeSuite.scala index 1c4dc428c..0d3603b6f 100644 --- a/blaze-core/src/test/scala/org/http4s/blaze/core/websocket/WebSocketHandshakeSuite.scala +++ b/blaze-core/src/test/scala/org/http4s/blaze/core/websocket/WebSocketHandshakeSuite.scala @@ -17,7 +17,7 @@ package org.http4s.blaze.core.websocket import cats.effect.IO -import cats.effect.std.Random +import cats.effect.std.SecureRandom import munit.CatsEffectSuite class WebSocketHandshakeSuite extends CatsEffectSuite { @@ -30,7 +30,7 @@ class WebSocketHandshakeSuite extends CatsEffectSuite { test("WebSocketHandshake should do a round trip") { for { - random <- Random.javaSecuritySecureRandom[IO] + random <- SecureRandom.javaSecuritySecureRandom[IO] client <- WebSocketHandshake.clientHandshaker[IO]("www.foo.com", random) hs = client.initHeaders valid <- WebSocketHandshake.serverHandshake[IO](hs) diff --git a/blaze-server/src/main/scala/org/http4s/blaze/server/BlazeServerBuilder.scala b/blaze-server/src/main/scala/org/http4s/blaze/server/BlazeServerBuilder.scala index 71d0f34ef..e68b9f14c 100644 --- a/blaze-server/src/main/scala/org/http4s/blaze/server/BlazeServerBuilder.scala +++ b/blaze-server/src/main/scala/org/http4s/blaze/server/BlazeServerBuilder.scala @@ -428,7 +428,7 @@ class BlazeServerBuilder[F[_]] private ( for { // blaze doesn't have graceful shutdowns, which means it may continue to submit effects, // ever after the server has acknowledged shutdown, so we just need to allocate - dispatcher <- Resource.eval(Dispatcher[F].allocated.map(_._1)) + dispatcher <- Resource.eval(Dispatcher.parallel[F].allocated.map(_._1)) scheduler <- tickWheelResource _ <- Resource.eval(verifyTimeoutRelations()) diff --git a/blaze-server/src/test/scala/org/http4s/blaze/server/Http1ServerStageSpec.scala b/blaze-server/src/test/scala/org/http4s/blaze/server/Http1ServerStageSpec.scala index c54a5a6da..990177448 100644 --- a/blaze-server/src/test/scala/org/http4s/blaze/server/Http1ServerStageSpec.scala +++ b/blaze-server/src/test/scala/org/http4s/blaze/server/Http1ServerStageSpec.scala @@ -58,7 +58,7 @@ class Http1ServerStageSpec extends CatsEffectSuite { def apply() = d override def beforeAll(): IO[Unit] = - Dispatcher[IO].allocated.map { case (dispatcher, cancelation) => + Dispatcher.parallel[IO].allocated.map { case (dispatcher, cancelation) => shutdown = cancelation d = dispatcher }