/startable-adaptor

Primary LanguageTypeScriptBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

adaptor

adaptor 函数在当前线程启动一个 Startable 对象,并捕获 SIGTERM/SIGINT 信号优雅退出,还可以设置超时时间。

interface Adaptor {
    (
        daemon: Startable,
        startTimeout?: number,
        stopTimeout?: number,
        signalTimeout?: number,
    ): void;
}