baryshev/connect-domain

Shut down after errors

Opened this issue · 2 comments

According to the domain module docs (and common sense), in case of an unhandled exception the process should stop accepting new connections and eventually shut down.

A sane default behavior would be to stop listening on http port(s) and do a process.exit from setTimeout with a reasonable delay (30 seconds?), plus an event to add any app-specific shutdown logic.

is this possible? did you find any way to do this?

I have done this with "graceful" module, you can check it out.