Role of `ZIO.executor` in the http4s + ZIO Adopt Tapir template

Hello :wave:

I’m not sure if it’s a “bug” in the template or am I misunderstanding something. Given this code:

    ZIO.executor.flatMap { _ =>
        .withHttpApp(Router("/" -> routes).orNotFound)
        .use { server =>
          for {
            _ <- Console.printLine(s"Server started at http://localhost:${server.address.getPort}. Press ENTER key to exit.")
            _ <- Console.readLine
          } yield ()

Do we really need the ZIO.executor? I know we needed it for the Blaze server (for .withExecutionContext), but Ember doesn’t seem to use it. Is the fact that the executor is “in scope” doing somerthing?


Yeah maybe that’s a leftover from the Blaze → Ember migration and we don’t need that … we’ll check :slight_smile:

1 Like