Skip to content

Instantly share code, notes, and snippets.

@ramn
Created August 21, 2011 23:14
Show Gist options
  • Save ramn/1161326 to your computer and use it in GitHub Desktop.
Save ramn/1161326 to your computer and use it in GitHub Desktop.
Register ShutdownHook (Scala)
object ShutDown {
def main(args: Array[String]) {
sys.ShutdownHookThread {
println("exiting")
}
println("begin sleep")
Thread.sleep(5000L)
println("done sleeping")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment