async-interval-job
v1.2.0
Published
setInterval for promises and async functions. Support graceful shutdown and prevent multiple executions from overlapping in time.
Downloads
25
Maintainers
Readme
setInterval for promises and async/sync functions.
- Support graceful shutdown.
- Prevent multiple executions from overlapping in time.
🔗 Link
📥 Install
npm i async-interval-job
🏆 Overview
📖 Usage
import { AsyncIntervalJob } from 'async-interval-job';
const job = new AsyncIntervalJob(async () => {
// Execute for each interval.
}, 60 * 1000);
job.start();
async function gracefulShutdown() {
await job.stop();
// Can close the db connections here ...
}
🤝 Contributing
Contributions, issues and feature requests are welcome!Feel free to check issues page.
🌟 Show your support
Give a ⭐️ if this project helped you!
📝 License
Copyright © 2022 a179346. This project is MIT licensed.
This README was generated with ❤️ by readme-md-generator