Hello
I’m not sure if it’s a “bug” in the template or am I misunderstanding something. Given this code:
ZIO.executor.flatMap { _ =>
EmberServerBuilder
.default[Task]
.withHost(Host.fromString("localhost").get)
.withPort(port)
.withHttpApp(Router("/" -> routes).orNotFound)
.build
.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?
Thanks!