wasmCloud/wascc-host

Trap signals for graceful shutdown

autodidaddict opened this issue · 3 comments

The wascc-host needs to be able to do a graceful shutdown so that it can, at the very least, invoke the unbind / deconfigure on each actor currently running so that it the capability providers have the ability to clean up resources for that actor.

Related to #49 , when the host starts up it should emit the appropriate event, and when the host dies due to signal capture, it should also emit the appropriate shutdown event.

The event notification portion of this feature only really makes sense in lattice mode, since if a single isolated host goes down, there's nothing that needs to be notified of this termination. Giving everything a chance to gracefully shut down is still useful even in isolation.

This should actually only apply to the generic host binary. A library struct should not trap operating system signals, that's the job of (IMHO) the binary in which the Host struct resides.