Exception/Error division in D

Jens Mueller jens.k.mueller at gmx.de
Thu May 31 13:05:33 PDT 2012


Walter Bright wrote:
> On 5/31/2012 12:40 AM, Jens Mueller wrote:
> >How do I do a graceful shutdown if finally and scope is not guaranteed
> >to be executed? Assuming onAssertError, etc. is of no use because I need
> >to perform different shutdowns due to having different cases or if I
> >defined my own Error, let's say for some device.
> 
> There's no way to guarantee a graceful shutdown.
> 
> No way.
> 
> If you must have such, then the way to do it is to divide your
> application into separate processes that communicate via
> interprocess communication, then when one component fails the rest
> of your app can restart it or do what's necessary, as the rest is
> not in an invalid state.

Okay, let's assume I have separate processes maybe even processes on
different machines. In one process I get an error. Let's say I want to
trigger the other process that it restarts the process or just logs the
event whatever makes sense.
How do I do this if it not guaranteed that finally/scope blocks are
being executed?

I don't need a guarantee that the shutdown will work in each and every
case. All I need is the possibility to perform a more graceful shutdown.

Jens


More information about the Digitalmars-d mailing list