#1846 Shutting down AbstractMain in service mode?

tactics Mon 19 Mar 2012

When you call AbstractMain.runServices, is there a way to signal from within the program that the services are all finished, and execution can continue from the point where runServices was called?

brian Mon 19 Mar 2012

Not really today. That guy just goes to sleep forever to ensure daemon threads keep on running. I'm not sure how another thread could signal everything was done without using actors (which is probably not a dependency we'd want to inject into that class). We could potentially goto into a loop sleeping and then checking for alive services until all services are stopped (sort of like a poll loop). I'd have to think about that, but what do others think of that change?

Typically what I do in my code is just have someone called Env.exit which then runs the shutdown handler for a clean shutdown.

tactics Mon 19 Mar 2012

Env.exit is good enough for my purposes :)

Login or Signup to reply.