1.2.0 • Published 2 years ago

async-interval-job v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

image

📖 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