You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

async-interval-job

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-interval-job

setInterval for promises and async functions. Support graceful shutdown and prevent multiple executions from overlapping in time.

1.2.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

⭕ async-interval-job ⭕

Documentation Documentation Documentation Maintenance License: MIT

setInterval for promises and async/sync functions.

  • Support graceful shutdown.
  • Prevent multiple executions from overlapping in time.

📥 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

Keywords

async-interval-job

FAQs

Package last updated on 01 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts