by robfig · 14y ago · 0 comments
Here is a description of how it works: http://robfig.github.com/revel/manual/howrevelworks.html
Basically: In development mode, it runs a proxy (called the "harness") that watches your source for changes and recompiles/restarts your server on the next request, if necessary, using the "go build" tool. The go build process is incremental, so in theory should only recompile packages that have changed (and those that depend on them)
Code: http://code.google.com/p/rsc/source/browse/#hg%2Fdevweb
// Devweb is a simple environment for developing a web server.
// It runs its own web server on the given address and proxies
// all requests to the http server program named by importpath.
// It takes care of recompiling and restarting the program as needed.
And, he uses "go build" to build the program: out, err := exec.Command("go", "build", "-o", "prox.exe", rootPackage).CombinedOutput()
It appears to do more than Revel does, though -- I will look at it more closely to see what extra it provides. Wish I had seen this before!It's not what's used in the App Engine SDK. I believe it was inspired by what we do in the App Engine SDK, though.
This is a good reason to learn go :)