15 lines
No EOL
316 B
JavaScript
15 lines
No EOL
316 B
JavaScript
import nman from "./dist/nman.js"
|
|
|
|
nman.addShutdownTask(() => {
|
|
console.log("sync task");
|
|
}, 1000, 2);
|
|
|
|
nman.addShutdownTask(() => new Promise((res) => {
|
|
console.log("async ...");
|
|
setTimeout(()=>{
|
|
console.log("async task: done");
|
|
res();
|
|
}, 1000);
|
|
}), 5000, 1);
|
|
|
|
await nman.shutdown(); |