1.0.3 • Published 4 years ago
sqlite-timeout v1.0.3
SQLITE-TIMEOUT
Set persistent timers that can survive outages and restarts with sqlite.
Installation
npm i sqlite-timeout
Example Usage
var sqliteTimeout = require('sqlite-timeout');
sqliteTimeout("somethingIsDone", 10000).then(st => { // The event "somethingIsDone" will be emitted in 10 seconds.
st.on("somethingIsDone", () => {
// Do something
})
})
sqlite-timeout emits an event after the delay has passed, then returns an event emitter. Every timeout returns the same event emitter meaning there is no need to call it more than once. The method IS asynchronous.