Created
August 21, 2011 23:14
-
-
Save ramn/1161326 to your computer and use it in GitHub Desktop.
Register ShutdownHook (Scala)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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