nMan/example.mjs

15 lines
316 B
JavaScript
Raw Normal View History

2023-02-25 17:38:41 +01:00
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();