mqlight / java-mqlight

This Java package provides the high-level API by which you can interact with the MQ Light runtime.
Apache License 2.0
10 stars 9 forks source link

Dont make core threads timeout on TimerServiceImpl #11

Closed leachbj closed 9 years ago

leachbj commented 9 years ago

This setting is causing the Threads to be shutdown after every task however since there are always jobs to run we can just leave the thread alive. At worst this leaves 1 idle thread.

Fixes #7

dnwe commented 9 years ago

I believe the issue with this approach is that with a indefinitely lived thread, the JVM won't shutdown unless you can ensure executor.shutdown() has been called.

Guava provides some wrappers to try and enforce this using shutdown hooks

https://guava-libraries.googlecode.com/svn/tags/release04/javadoc/com/google/common/util/concurrent/MoreExecutors.html

leachbj commented 9 years ago

Alternate solution in 79dfe2cfeedf70f719731d13c6bf3d9eb6cbec80