fslockjs
Version:
Easy to use file system queue with locking and events. Provide Asynchronous utilities for Directories and File
22 lines (19 loc) • 445 B
JavaScript
function start() {
const self = this;
if (!this.autoExecStarted) this.autoExecStarted = true;
const continuouslyExecute = () => {
if (self.state === 'processingAll') {
return;
}
self.processAll()
.then(() => {
if (self.autoExecStarted) {
setTimeout(() => {
continuouslyExecute();
}, 20)
}
})
}
continuouslyExecute();
}
export default start;