Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 560 Bytes

Job.md

File metadata and controls

28 lines (21 loc) · 560 Bytes

Job API

execution()

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')

getResults()

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')