nMan/example.mjs
jusax23 02708a6374
Some checks failed
ci/woodpecker/tag/woodpecker Pipeline failed
features
2023-02-25 17:38:41 +01:00

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();