Skip to content

isProcessingJob

function isProcessingJob<T>(job): boolean;

Defined in: packages/core/src/jobs/guards.ts:122

Type guard to check if a job is currently being processed.

A convenience helper for checking if a job is actively running. Equivalent to job.status === JobStatus.PROCESSING but with better semantics.

Type ParameterDescription
TThe type of the job’s data payload
ParameterTypeDescription
jobJob<T>The job to check

boolean

true if the job status is 'processing'

const jobs = await monque.getJobs();
const activeJobs = jobs.filter(isProcessingJob);
console.log(`${activeJobs.length} jobs currently running`);