Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Startup / Shutdown hooks #37
E.g. initialize / shutdown a redis connection pool. I didn't see a place to put these. Many require a call for the threadpool to be shutdown for the app to exit cleanly.
I suppose one could put stuff on a singleton object, that the controller could access, and have the thing that starts up FinatraServer manage starting up and shutting down the stuff that lives there?
So FinatraServer.start() is usually called from a main method in your App object, you could just initialize the redis threadpool in that main method, and attach it to val on the App object, making it available throughout your whole app. As for shutdown, you could register a jvm shutdown hook to cleanly shutdown the redis threadpool if you wish, like so:
Does this answer your question?