diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 63c999da96..980d7ee574 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -5,7 +5,7 @@ object Dependencies { val NettyVersion = "4.1.75.Final" val NettyIncubatorVersion = "0.0.13.Final" val ScalaCompactCollectionVersion = "2.7.0" - val ZioVersion = "2.0.0-RC4" + val ZioVersion = "2.0.0-RC5" val SttpVersion = "3.3.18" val `jwt-core` = "com.github.jwt-scala" %% "jwt-core" % JwtCoreVersion diff --git a/zio-http/src/main/scala/zhttp/service/ChannelFactory.scala b/zio-http/src/main/scala/zhttp/service/ChannelFactory.scala index 654e0f1f30..b4c70b51c4 100644 --- a/zio-http/src/main/scala/zhttp/service/ChannelFactory.scala +++ b/zio-http/src/main/scala/zhttp/service/ChannelFactory.scala @@ -9,11 +9,11 @@ import io.netty.incubator.channel.uring.IOUringSocketChannel import zio.{UIO, ZIO, ZLayer} object ChannelFactory { - def nio: ZLayer[Any, Nothing, ChannelFactory] = Live.nio.toLayer - def epoll: ZLayer[Any, Nothing, ChannelFactory] = Live.epoll.toLayer - def uring: ZLayer[Any, Nothing, ChannelFactory] = Live.uring.toLayer - def embedded: ZLayer[Any, Nothing, ChannelFactory] = Live.embedded.toLayer - def auto: ZLayer[Any, Nothing, ChannelFactory] = Live.auto.toLayer + def nio: ZLayer[Any, Nothing, ChannelFactory] = ZLayer(Live.nio) + def epoll: ZLayer[Any, Nothing, ChannelFactory] = ZLayer(Live.epoll) + def uring: ZLayer[Any, Nothing, ChannelFactory] = ZLayer(Live.uring) + def embedded: ZLayer[Any, Nothing, ChannelFactory] = ZLayer(Live.embedded) + def auto: ZLayer[Any, Nothing, ChannelFactory] = ZLayer(Live.auto) def make[A <: Channel](fn: () => A): UIO[JChannelFactory[A]] = ZIO.succeed(new JChannelFactory[A] { override def newChannel(): A = fn() diff --git a/zio-http/src/main/scala/zhttp/service/server/ServerChannelFactory.scala b/zio-http/src/main/scala/zhttp/service/server/ServerChannelFactory.scala index 44376e4fcf..87f182f0db 100644 --- a/zio-http/src/main/scala/zhttp/service/server/ServerChannelFactory.scala +++ b/zio-http/src/main/scala/zhttp/service/server/ServerChannelFactory.scala @@ -9,10 +9,10 @@ import zhttp.service.{ChannelFactory, ServerChannelFactory} import zio.{UIO, ZLayer} object ServerChannelFactory { - def nio: ZLayer[Any, Nothing, ServerChannelFactory] = Live.nio.toLayer - def epoll: ZLayer[Any, Nothing, ServerChannelFactory] = Live.epoll.toLayer - def uring: ZLayer[Any, Nothing, ServerChannelFactory] = Live.uring.toLayer - def auto: ZLayer[Any, Nothing, ServerChannelFactory] = Live.auto.toLayer + def nio: ZLayer[Any, Nothing, ServerChannelFactory] = ZLayer(Live.nio) + def epoll: ZLayer[Any, Nothing, ServerChannelFactory] = ZLayer(Live.epoll) + def uring: ZLayer[Any, Nothing, ServerChannelFactory] = ZLayer(Live.uring) + def auto: ZLayer[Any, Nothing, ServerChannelFactory] = ZLayer(Live.auto) object Live { def nio: UIO[JChannelFactory[ServerChannel]] = ChannelFactory.make(() => new NioServerSocketChannel()) diff --git a/zio-http/src/test/scala/zhttp/http/HExitSpec.scala b/zio-http/src/test/scala/zhttp/http/HExitSpec.scala index a32e2cc008..643c46efce 100644 --- a/zio-http/src/test/scala/zhttp/http/HExitSpec.scala +++ b/zio-http/src/test/scala/zhttp/http/HExitSpec.scala @@ -6,7 +6,7 @@ import zio.test._ import zio.{ZIO, durationInt} object HExitSpec extends ZIOSpecDefault with HExitAssertion { - def spec: ZSpec[Environment, Failure] = { + def spec: ZSpec[Environment, Any] = { import HExit._ suite("HExit")( test("out") { diff --git a/zio-http/src/test/scala/zhttp/internal/DynamicServer.scala b/zio-http/src/test/scala/zhttp/internal/DynamicServer.scala index 888e5a2538..81b3925c79 100644 --- a/zio-http/src/test/scala/zhttp/internal/DynamicServer.scala +++ b/zio-http/src/test/scala/zhttp/internal/DynamicServer.scala @@ -41,12 +41,13 @@ object DynamicServer { def httpURL: ZIO[DynamicServer, Nothing, String] = baseURL(Scheme.HTTP) - def live: ZLayer[Any, Nothing, DynamicServer] = { - for { - ref <- Ref.make(Map.empty[Id, HttpApp[Any, Throwable]]) - pr <- Promise.make[Nothing, Start] - } yield new Live(ref, pr) - }.toLayer + def live: ZLayer[Any, Nothing, DynamicServer] = + ZLayer { + for { + ref <- Ref.make(Map.empty[Id, HttpApp[Any, Throwable]]) + pr <- Promise.make[Nothing, Start] + } yield new Live(ref, pr) + } def port: ZIO[DynamicServer, Nothing, Int] = ZIO.environmentWithZIO[DynamicServer](_.get.port) diff --git a/zio-http/src/test/scala/zhttp/service/WebSocketServerSpec.scala b/zio-http/src/test/scala/zhttp/service/WebSocketServerSpec.scala index 23decffa29..ebf13c8b29 100644 --- a/zio-http/src/test/scala/zhttp/service/WebSocketServerSpec.scala +++ b/zio-http/src/test/scala/zhttp/service/WebSocketServerSpec.scala @@ -18,7 +18,7 @@ object WebSocketServerSpec extends HttpRunnableSpec { override def spec = suite("Server") { app.as(List(websocketServerSpec, websocketFrameSpec)) - }.provideLayerShared(env) @@ timeout(10 seconds) + }.provideLayerShared(env) @@ timeout(60 seconds) @@ zio.test.TestAspect.withLiveClock def websocketServerSpec = suite("WebSocketServer") { suite("connections") {