The job's ID.
Whether the job's results have been loaded. If set to true
, the job's
result can be accessed from Job.result.
Fetches the job's completion state.
Returns true
if the job has completed, false
otherwise.
// poll for the job to complete
while (!(await job.getCompleted())) {
await timeout(1000);
}
// job result is now available and can be loaded
await job.load();
console.log(job.result);
Loads the job's result from the database if it is not already loaded.
// poll for the job to complete
while (!job.isLoaded) {
await timeout(1000);
const result = await job.load();
console.log(result);
}
// job result is now loaded and can also be accessed from job.result
console.log(job.result);
Represents an async job in a database.Database.