From 5661ac78c4afba6266f34bf4347f0a6b60555b90 Mon Sep 17 00:00:00 2001 From: Adam Fraser Date: Sun, 28 Aug 2022 07:00:35 -0700 Subject: [PATCH] Update ZIO Version (#1406) update zio version --- project/Dependencies.scala | 2 +- .../src/main/scala/zhttp.benchmarks/HttpRouteTextPerf.scala | 4 ++-- zio-http/src/main/scala/zhttp/service/HttpRuntime.scala | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 2a4147b3dd..1347a0246e 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -6,7 +6,7 @@ object Dependencies { val NettyVersion = "4.1.79.Final" val NettyIncubatorVersion = "0.0.14.Final" val ScalaCompactCollectionVersion = "2.8.1" - val ZioVersion = "2.0.0" + val ZioVersion = "2.0.1" val SttpVersion = "3.3.18" val `jwt-core` = "com.github.jwt-scala" %% "jwt-core" % JwtCoreVersion diff --git a/zio-http-benchmarks/src/main/scala/zhttp.benchmarks/HttpRouteTextPerf.scala b/zio-http-benchmarks/src/main/scala/zhttp.benchmarks/HttpRouteTextPerf.scala index c777971641..2db6cedd23 100644 --- a/zio-http-benchmarks/src/main/scala/zhttp.benchmarks/HttpRouteTextPerf.scala +++ b/zio-http-benchmarks/src/main/scala/zhttp.benchmarks/HttpRouteTextPerf.scala @@ -21,7 +21,7 @@ class HttpRouteTextPerf { @Benchmark def benchmarkHttpProgram(): Unit = { - Unsafe.unsafeCompat { implicit u => + Unsafe.unsafe { implicit unsafe => runtime.unsafe.run(httpProgram) () } @@ -29,7 +29,7 @@ class HttpRouteTextPerf { @Benchmark def benchmarkUIOProgram(): Unit = { - Unsafe.unsafeCompat { implicit u => + Unsafe.unsafe { implicit unsafe => runtime.unsafe.run(UIOProgram) () } diff --git a/zio-http/src/main/scala/zhttp/service/HttpRuntime.scala b/zio-http/src/main/scala/zhttp/service/HttpRuntime.scala index 728815f53a..81904ccd49 100644 --- a/zio-http/src/main/scala/zhttp/service/HttpRuntime.scala +++ b/zio-http/src/main/scala/zhttp/service/HttpRuntime.scala @@ -16,7 +16,7 @@ final class HttpRuntime[+R](strategy: HttpRuntime.Strategy[R]) { private def closeListener(rtm: Runtime[Any], fiber: Fiber.Runtime[_, _]): GenericFutureListener[Future[_ >: Void]] = (_: Future[_ >: Void]) => - Unsafe.unsafeCompat { implicit u => + Unsafe.unsafe { implicit unsafe => val _ = rtm.unsafe.fork { fiber.interrupt.as(log.debug(s"Interrupted Fiber: [${fiber.id}]")) } @@ -44,7 +44,7 @@ final class HttpRuntime[+R](strategy: HttpRuntime.Strategy[R]) { // Close the connection if the program fails // When connection closes, interrupt the program - Unsafe.unsafeCompat { implicit u => + Unsafe.unsafe { implicit unsafe => var close: GenericFutureListener[Future[_ >: Void]] = null val fiber = rtm.unsafe.fork(program) @@ -90,7 +90,7 @@ object HttpRuntime { ZIO .foreach(group.asScala) { javaExecutor => val executor = Executor.fromJavaExecutor(javaExecutor) - ZIO.runtime[R].daemonChildren.onExecutor(executor).map { runtime => + ZIO.runtime[R].onExecutor(executor).map { runtime => javaExecutor -> runtime } }