akkadotnet/akka.net — pull request #261 by Aaronontheweb (2014-08-14 19:47:54+00:00)
Title: [Getting ready for v0.6.3] upgraded Helios and added method to block application thread until ActorSystem shutdown

**This pr is not ready to be accepted just yet, as it depends on a new version of Helios that has not been pushed to NuGet yet. Planning on releasing those bits today.**

I wanted to put this in front of the Akka.NET community before we release Akka.NET v0.6.3 because I added a small feature to the `ActorSystem` implementation.

Someone asked for this on an earlier issue, but I've created an ability to prevent console applications / Windows Services from exiting until the `ActorSystem` shuts down - the goal here is to prevent the need for adding one of the usual hacks like `Console.ReadKey()`.

Here's how this feature works:

````
var actorSystem = ActorSystem.Create("actorSystem");
// ... do some stuff to initialize actors et al
actorSystem.WaitForShutdown(); //blocks until actorSystem.Shutdown() is called and completed
// ... rest of program executes
````

If you're already hosting your actor systems inside ASP.NET MVC, WCF, or a client application then the main thread already blocks on the message loop those frameworks use - so you won't need this.

However, if you want to be able to build long-running actor systems inside console applications or Windows Services, this should make it easier to do that. To shutdown the actor system in these scenarios, you'll either need to do it asynchronously or just kill the process (which is more or less the default for console applications.)

Any objections to including this?