Skip to content

Commit

Permalink
Update ZIO Version (#1406)
Browse files Browse the repository at this point in the history
update zio version
  • Loading branch information
adamgfraser authored Aug 28, 2022
1 parent 11f2d06 commit 5661ac7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ class HttpRouteTextPerf {

@Benchmark
def benchmarkHttpProgram(): Unit = {
Unsafe.unsafeCompat { implicit u =>
Unsafe.unsafe { implicit unsafe =>
runtime.unsafe.run(httpProgram)
()
}
}

@Benchmark
def benchmarkUIOProgram(): Unit = {
Unsafe.unsafeCompat { implicit u =>
Unsafe.unsafe { implicit unsafe =>
runtime.unsafe.run(UIOProgram)
()
}
Expand Down
6 changes: 3 additions & 3 deletions zio-http/src/main/scala/zhttp/service/HttpRuntime.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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}]"))
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
}
}
Expand Down

0 comments on commit 5661ac7

Please sign in to comment.