diff --git a/build.sbt b/build.sbt index 61b8384a..f0008993 100644 --- a/build.sbt +++ b/build.sbt @@ -22,7 +22,7 @@ lazy val root = tlCrossRootProject.aggregate(servlet, examples) val asyncHttpClientVersion = "2.12.3" val jettyVersion = "10.0.13" -val http4sVersion = "0.23.16" +val http4sVersion = "0.23.17" val munitCatsEffectVersion = "1.0.7" val servletApiVersion = "4.0.1" diff --git a/examples/src/main/scala/com/example/Bootstrap.scala b/examples/src/main/scala/com/example/Bootstrap.scala index 93b0da4a..09983ffb 100644 --- a/examples/src/main/scala/com/example/Bootstrap.scala +++ b/examples/src/main/scala/com/example/Bootstrap.scala @@ -40,7 +40,9 @@ class Bootstrap extends ServletContextListener { @volatile private var shutdown: IO[Unit] = IO.unit override def contextInitialized(sce: ServletContextEvent): Unit = { - Dispatcher[IO].allocated + Dispatcher + .parallel[IO] + .allocated .flatMap { case (dispatcher, shutdown) => IO(this.shutdown = shutdown) *> IO(sce.getServletContext.mountRoutes("example", routes, dispatcher = dispatcher)) diff --git a/servlet/src/main/scala/org/http4s/servlet/AsyncHttp4sServlet.scala b/servlet/src/main/scala/org/http4s/servlet/AsyncHttp4sServlet.scala index 718aed26..32cd3a97 100644 --- a/servlet/src/main/scala/org/http4s/servlet/AsyncHttp4sServlet.scala +++ b/servlet/src/main/scala/org/http4s/servlet/AsyncHttp4sServlet.scala @@ -29,7 +29,7 @@ import javax.servlet.http.HttpServletResponse import scala.annotation.nowarn import scala.concurrent.duration.Duration -class AsyncHttp4sServlet[F[_]] @deprecated("Use AsyncHttp4sServlet.builder", "0.23.16") ( +class AsyncHttp4sServlet[F[_]] @deprecated("Use AsyncHttp4sServlet.builder", "0.23.17") ( httpApp: HttpApp[F], asyncTimeout: Duration = Duration.Inf, servletIo: ServletIo[F], diff --git a/servlet/src/test/scala/org/http4s/servlet/AsyncHttp4sServletSuite.scala b/servlet/src/test/scala/org/http4s/servlet/AsyncHttp4sServletSuite.scala index b3ff6b66..fbac1b63 100644 --- a/servlet/src/test/scala/org/http4s/servlet/AsyncHttp4sServletSuite.scala +++ b/servlet/src/test/scala/org/http4s/servlet/AsyncHttp4sServletSuite.scala @@ -57,7 +57,7 @@ class AsyncHttp4sServletSuite extends CatsEffectSuite { .orNotFound private val servletServer = - ResourceFixture[Int](Dispatcher[IO].flatMap(d => TestEclipseServer(servlet(d)))) + ResourceFixture[Int](Dispatcher.parallel[IO].flatMap(d => TestEclipseServer(servlet(d)))) private def get(client: HttpClient, serverPort: Int, path: String): IO[String] = IO.blocking( @@ -134,7 +134,8 @@ class AsyncHttp4sServletSuite extends CatsEffectSuite { servletServer.test("AsyncHttp4sServlet handle two-chunk, deferred POST") { server => // Show that we can read, be blocked, and read again val bytes = Stream.range(0, DefaultChunkSize).map(_.toByte).to(Array) - Dispatcher[IO] + Dispatcher + .parallel[IO] .use { dispatcher => clientR.use { client => for { @@ -174,7 +175,8 @@ class AsyncHttp4sServletSuite extends CatsEffectSuite { // We shouldn't block when we receive less than a chunk at a time servletServer.test("AsyncHttp4sServlet handle two itsy-bitsy deferred chunk POST") { server => - Dispatcher[IO] + Dispatcher + .parallel[IO] .use { dispatcher => clientR.use { client => for { @@ -214,7 +216,8 @@ class AsyncHttp4sServletSuite extends CatsEffectSuite { servletServer.test("AsyncHttp4sServlet should not reorder lots of itsy-bitsy chunks") { server => val body = (0 until 4096).map(_.toByte).toArray - Dispatcher[IO] + Dispatcher + .parallel[IO] .use { dispatcher => clientR.use { client => for { diff --git a/servlet/src/test/scala/org/http4s/servlet/BlockingHttp4sServletSuite.scala b/servlet/src/test/scala/org/http4s/servlet/BlockingHttp4sServletSuite.scala index e8491e8d..79070f11 100644 --- a/servlet/src/test/scala/org/http4s/servlet/BlockingHttp4sServletSuite.scala +++ b/servlet/src/test/scala/org/http4s/servlet/BlockingHttp4sServletSuite.scala @@ -48,7 +48,7 @@ class BlockingHttp4sServletSuite extends CatsEffectSuite { .orNotFound private val servletServer = ResourceFixture( - Dispatcher[IO].flatMap(d => TestEclipseServer(servlet(d))) + Dispatcher.parallel[IO].flatMap(d => TestEclipseServer(servlet(d))) ) private def get(serverPort: Int, path: String): IO[String] = diff --git a/servlet/src/test/scala/org/http4s/servlet/RouterInServletSuite.scala b/servlet/src/test/scala/org/http4s/servlet/RouterInServletSuite.scala index 394334a3..2e87cc97 100644 --- a/servlet/src/test/scala/org/http4s/servlet/RouterInServletSuite.scala +++ b/servlet/src/test/scala/org/http4s/servlet/RouterInServletSuite.scala @@ -45,22 +45,28 @@ class RouterInServletSuite extends CatsEffectSuite { ) private val serverWithoutRouter = - ResourceFixture[Int](Dispatcher[IO].flatMap(d => mkServer(mainRoutes, dispatcher = d))) + ResourceFixture[Int](Dispatcher.parallel[IO].flatMap(d => mkServer(mainRoutes, dispatcher = d))) private val server = - ResourceFixture[Int](Dispatcher[IO].flatMap(d => mkServer(router, dispatcher = d))) + ResourceFixture[Int](Dispatcher.parallel[IO].flatMap(d => mkServer(router, dispatcher = d))) private val serverWithContextPath = ResourceFixture[Int]( - Dispatcher[IO].flatMap(d => mkServer(router, contextPath = "/context", dispatcher = d)) + Dispatcher + .parallel[IO] + .flatMap(d => mkServer(router, contextPath = "/context", dispatcher = d)) ) private val serverWithServletPath = ResourceFixture[Int]( - Dispatcher[IO].flatMap(d => mkServer(router, servletPath = "/servlet/*", dispatcher = d)) + Dispatcher + .parallel[IO] + .flatMap(d => mkServer(router, servletPath = "/servlet/*", dispatcher = d)) ) private val serverWithContextAndServletPath = ResourceFixture[Int]( - Dispatcher[IO].flatMap(d => - mkServer(router, contextPath = "/context", servletPath = "/servlet/*", dispatcher = d) - ) + Dispatcher + .parallel[IO] + .flatMap(d => + mkServer(router, contextPath = "/context", servletPath = "/servlet/*", dispatcher = d) + ) ) serverWithoutRouter.test(