--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/a74cf356-074e-4d6c-8a63-69c087e574e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "play-framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/play-framework/3uLFHhWMudo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/CAJmgB61-ShujXRmZ-sPnkk48-ow3B6VF4u7Ec-tDCJDhJJdKog%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/fd9c52ab-cd06-fdfd-1a8f-152bdf2b2329%40gmail.com.
You'd set up an actor that would track all the resources you want
to shut down, and then have that call System.exit() once you had
confirmation everything was down. Play is stateless, so you're
not losing anything after that point.
Will.
Sorry, I don't think I said what I meant. For an app that decides that it wants to shut down of its own volition, even though no exceptions have been thrown and some might say that nothing is wrong, how might that best be done? Ultimately, whatever mechanism is employed, it is clear that DefaultApplicationLifecycle.stop() will be called.
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/1d40b040-2575-4da2-904d-a20244215a3c%40googlegroups.com.
Shutdown hooks are called when the application exits normally (System.exit(0)), but the shutdown hooks may be called in any order.
If you're asking "how do I call into the application shutdown
lifecycle" -- that's something that is mostly there to support the
development "live-reload" feature, so the JVM doesn't memory leak
and OOM. In live applications, Play runs until it's hit by a
signal, like any other long running Unix process.
If you have systems that need to be gracefully shut off or
segregated, then the best way to do it is by building in circuit
breakers and bulkheads so you can reconnect to your resources.
Then, if you want to have a feature that shuts off all external
access, you can flip the switch.
Most of the major work in Play is to support this dynamic
connection style -- part of the reason that Plugins and Singleton
object based JDBC connection pools are painful is because they
don't let you swap out, proxy or reconnect through to different
resources.
Will.
After I call System.exit, will the shutdown hooks be called before the webapp exits?
Mike
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/02ee20e8-5c5c-018f-d294-0651fda7d92d%40gmail.com.
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/73fda281-16bc-4b27-a4d3-d1cf95d912bd%40googlegroups.com.
Just tested an found that the custom app loader does not load until after the first request in dev mode. So that is also out.
What other options exist?
I tested and found that an eager singleton does not run in dev mode before the first request. Have you tested this yourself and found otherwise?
You are shifting the topic from issues with "to cause a class constructor to run immediately when a Play webapp starts, even in dev mode, create an eager singleton", to "you cannot do that, why would you want to"? The new topic is not appropriate for this venue.
If there is no way to cause a class constructor to load immediately the docs should be updated. So far I've only looked at Guice-related mechanisms. What other mechanisms exist which would make this possible?