fslockjs
Version:
Easy to use file system queue with locking and events. Provide Asynchronous utilities for Directories and File
22 lines (18 loc) • 545 B
JavaScript
import EventEmitter from 'events';
import execution from './methods/execution.js';
class Job extends EventEmitter {
constructor(props = {}) {
super()
if (!props.command || !props.path) {
throw new Error('Unexpected new job properties');
}
this.command = props.command;
this.path = props.path;
this.params = props.params || null;
this.state = 'idle';
this.result = null;
this.error = null;
}
}
Job.prototype.execution = execution;
export default Job;