typesafehub / akka-contrib-extra

ConductR Akka contributions
Other
9 stars 16 forks source link

Reliable shutdown of BlockingProcess #34

Closed huntc closed 9 years ago

huntc commented 9 years ago

In order to free up threads blocked on reading standard output and standard error (stdio), I formally had another close the associated streams. This worked under OS X, but not under Ubuntu.

I've used a similar approach in this patch but instead of closing down the associated streams, I terminate the process that the streams are associated with. This is completely correct given that the actor system wants to shutdown. I've also tested this on Ubuntu and all appears well.

Along the way I've dispensed with the isDetached flag as this does not make sense for a blocking actor - we want to attach ourselves to its stdio and we'd never be able to shut the actor down. If we want to run a background process that is detached then we are unlikely to want to view its output (it is something to live outside of the context of this actor).