Closed gajus closed 4 years ago
I agree with @dcherman, that dependencies should be handled by registered handler.
This introduces unnecessary ambiguity. There is nothing stopping user from simply implementing their own collection of methods that need to be run in parallel, i.e.
registerShutdownHandler(async () => {
await Promise.all([
userCollectionOfShutdownHandlers,
]);
});
Currently the shutdown handlers are executed sequentially.
Running shutdown handlers in parallel would potentially shorten the shutdown time.
Refer to https://github.com/gajus/lightship/issues/5#issuecomment-451775408 discussion.