1

I often run a dispatcher server in sbt ~run.

  unfiltered.netty.Http(port)
    .handler(plan)
    .run()

  Http.shutdown()

When I start up my server, it says:

Embedded server running on port 8080. Press any key to stop.

However, only ENTER will stop the server. Unfortunately, ENTER also stops sbt. How can I set up unfiltered so that it actually stops on any key within sbt? I would like pressing a key to stop the server and cause sbt to re-compile and re-run the application.

4

1 回答 1

0

您可以使用sbt-revolver和 JRebel 进行连续热重载。Scala 用户有一个免费的 JRebel 许可证。

  1. 启动 sbt 外壳。
  2. reStart启动一个退出被困的分叉 JVM。
  3. 如果您正确安装了 JRebel,编译后的类将从~products中加载到分叉的 JVM 中。

请参阅热重载

于 2013-11-15T04:15:17.710 回答