From d3dd86f0772bee006895de350d89ef9e20e5130c Mon Sep 17 00:00:00 2001 From: Flavio Brasil Date: Wed, 21 Feb 2024 08:36:00 -0800 Subject: [PATCH] avoid generic type in Netty's RunAsync --- .../tapir/server/netty/cats/NettyCatsServerInterpreter.scala | 2 +- .../sttp/tapir/server/netty/loom/NettyIdServerInterpreter.scala | 2 +- .../sttp/tapir/server/netty/NettyFutureServerInterpreter.scala | 2 +- .../main/scala/sttp/tapir/server/netty/internal/RunAsync.scala | 2 +- .../sttp/tapir/server/netty/zio/NettyZioServerInterpreter.scala | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/netty-server/cats/src/main/scala/sttp/tapir/server/netty/cats/NettyCatsServerInterpreter.scala b/server/netty-server/cats/src/main/scala/sttp/tapir/server/netty/cats/NettyCatsServerInterpreter.scala index e9e223461c..f288b26500 100644 --- a/server/netty-server/cats/src/main/scala/sttp/tapir/server/netty/cats/NettyCatsServerInterpreter.scala +++ b/server/netty-server/cats/src/main/scala/sttp/tapir/server/netty/cats/NettyCatsServerInterpreter.scala @@ -23,7 +23,7 @@ trait NettyCatsServerInterpreter[F[_]] { implicit val monad: MonadError[F] = new CatsMonadError[F] val runAsync = new RunAsync[F] { - override def apply[T](f: => F[T]): Unit = nettyServerOptions.dispatcher.unsafeRunAndForget(f) + override def apply(f: => F[Unit]): Unit = nettyServerOptions.dispatcher.unsafeRunAndForget(f): Unit } implicit val bodyListener: BodyListener[F, NettyResponse] = new NettyBodyListener(runAsync) diff --git a/server/netty-server/loom/src/main/scala/sttp/tapir/server/netty/loom/NettyIdServerInterpreter.scala b/server/netty-server/loom/src/main/scala/sttp/tapir/server/netty/loom/NettyIdServerInterpreter.scala index 4cd225e0eb..973e8df1d2 100644 --- a/server/netty-server/loom/src/main/scala/sttp/tapir/server/netty/loom/NettyIdServerInterpreter.scala +++ b/server/netty-server/loom/src/main/scala/sttp/tapir/server/netty/loom/NettyIdServerInterpreter.scala @@ -16,7 +16,7 @@ trait NettyIdServerInterpreter { new NettyToResponseBody[Id], nettyServerOptions.deleteFile, new RunAsync[Id] { - override def apply[T](f: => Id[T]): Unit = { + override def apply(f: => Id[Unit]): Unit = { val _ = f () } diff --git a/server/netty-server/src/main/scala/sttp/tapir/server/netty/NettyFutureServerInterpreter.scala b/server/netty-server/src/main/scala/sttp/tapir/server/netty/NettyFutureServerInterpreter.scala index a2255216dd..e3733e162d 100644 --- a/server/netty-server/src/main/scala/sttp/tapir/server/netty/NettyFutureServerInterpreter.scala +++ b/server/netty-server/src/main/scala/sttp/tapir/server/netty/NettyFutureServerInterpreter.scala @@ -37,6 +37,6 @@ object NettyFutureServerInterpreter { } private object FutureRunAsync extends RunAsync[Future] { - override def apply[T](f: => Future[T]): Unit = f + override def apply(f: => Future[Unit]): Unit = f: Unit } } diff --git a/server/netty-server/src/main/scala/sttp/tapir/server/netty/internal/RunAsync.scala b/server/netty-server/src/main/scala/sttp/tapir/server/netty/internal/RunAsync.scala index cd67e113de..691552fea2 100644 --- a/server/netty-server/src/main/scala/sttp/tapir/server/netty/internal/RunAsync.scala +++ b/server/netty-server/src/main/scala/sttp/tapir/server/netty/internal/RunAsync.scala @@ -1,5 +1,5 @@ package sttp.tapir.server.netty.internal trait RunAsync[F[_]] { - def apply[T](f: => F[T]): Unit + def apply(f: => F[Unit]): Unit } diff --git a/server/netty-server/zio/src/main/scala/sttp/tapir/server/netty/zio/NettyZioServerInterpreter.scala b/server/netty-server/zio/src/main/scala/sttp/tapir/server/netty/zio/NettyZioServerInterpreter.scala index 64a91e3cff..3137a4d78a 100644 --- a/server/netty-server/zio/src/main/scala/sttp/tapir/server/netty/zio/NettyZioServerInterpreter.scala +++ b/server/netty-server/zio/src/main/scala/sttp/tapir/server/netty/zio/NettyZioServerInterpreter.scala @@ -59,6 +59,6 @@ object NettyZioServerInterpreter { } private[netty] class ZioRunAsync[R](runtime: Runtime[R]) extends RunAsync[RIO[R, *]] { - override def apply[T](f: => RIO[R, T]): Unit = Unsafe.unsafe(implicit u => runtime.unsafe.runToFuture(f)) + override def apply(f: => RIO[R, Unit]): Unit = Unsafe.unsafe(implicit u => runtime.unsafe.runToFuture(f)): Unit } }