We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6bf1de0 + f0852fa commit f93a2c8Copy full SHA for f93a2c8
src/main/g8/src/main/scala/com/example/Main.scala
@@ -9,6 +9,7 @@ import org.http4s.ember.server._
9
import org.http4s._
10
import com.comcast.ip4s._
11
import smithy4s.http4s.SimpleRestJsonBuilder
12
+import scala.concurrent.duration._
13
14
object HelloWorldImpl extends HelloWorldService[IO] {
15
def hello(name: String, town: Option[String]): IO[Greeting] = IO.pure {
@@ -42,11 +43,11 @@ object Main extends IOApp.Simple {
42
43
.withPort(thePort)
44
.withHost(theHost)
45
.withHttpApp(routes.orNotFound)
46
+ .withShutdownTimeout(1.second)
47
.build
48
.productL(IO.println(message).toResource)
49
}
- .useForever
- .race(IO.readLine)
50
+ .surround(IO.readLine)
51
.void
52
.guarantee(IO.println("Goodbye!"))
53
0 commit comments