我可以看到 sbt-revolver 已设置并在喷雾罐上运行,但是当我向服务发出请求时,我的更改没有出现。
您可以在日志中看到 jrebel 正在做的事情:
[success] Total time: 1 s, completed Feb 24, 2013 3:13:18 AM
app: [INFO] [02/24/2013 03:13:19.497] [com-example-Boot-spray.io.io-bridge-dispatcher-7] [akka://com-example-Boot/user/io-bridge] akka://com-example-Boot/user/io-bridge started
app: [INFO] [02/24/2013 03:13:19.851] [com-example-Boot-akka.actor.default-dispatcher-2] [akka://com-example-Boot/user/http-server] akka://com-example-Boot/user/http-server started on localhost/127.0.0.1:9000
> ~products
[success] Total time: 0 s, completed Feb 24, 2013 3:13:23 AM
1. Waiting for source changes... (press enter to interrupt)
[info] Compiling 1 Scala source to /Users/tripled153/Development/src/Foundationv2/spray-template/target/scala-2.10/classes...
[success] Total time: 2 s, completed Feb 24, 2013 3:13:33 AM
2. Waiting for source changes... (press enter to interrupt)
但是更改我的特征中的消息不会出现在刷新时。
package com.example
import akka.actor.Actor
import spray.routing._
import spray.http._
import MediaTypes._
// we don't implement our route structure directly in the service actor because
// we want to be able to test it independently, without having to spin up an actor
class MyServiceActor extends Actor with MyService {
// the HttpService trait defines only one abstract member, which
// connects the services environment to the enclosing actor or test
def actorRefFactory = context
// this actor only runs our route, but you could add
// other things here, like request stream processing
// or timeout handling
def receive = runRoute(myRoute)
}
// this trait defines our service behavior independently from the service actor
trait MyService extends HttpService {
val myRoute =
path("") {
get {
respondWithMediaType(`text/html`) { // XML is marshalled to `text/xml` by default, so we simply override here
complete {
<html>
<body>
<h1>Say hello to <i>spray-routing</i> on <i>spray-can</i>!</h1>
</body>
</html>
}
}
}
}
}
这是建立在带有左轮手枪的喷雾罐示例之上的。 https://github.com/spray/spray-template