Allow to wait to execution of a task.
const job = new Job({command, path, params});
setTimeout(()=>{
job.emit('executed');
},500)
await job.execution();
console.log('500ms later. Do other stuff')
Tries to get the results, waits for execution before retuning it
const job = new Job({command, path, params});
setTimeout(()=>{
job.emit('executed');
},500)
const res = await job.getResults();
console.log('500ms later. Do thing with res')