AbstractThe type of data the job will process, which must extend Data<ObjectParser>.
Protected Abstract ReadonlydataThe Data class for this job, which is used for validation. Must be
defined by subclasses.
AbstractperformAbstract method that defines the job's logic after the data has been validated.
Subclasses must implement this method to define the actions taken with the validated input.
The validated input data.
A promise that resolves once the job processing is complete.
Validates the incoming data using the data class defined in the subclass.
This method automatically creates an instance of the data class using the provided ObjectParser.
The ObjectParser containing the incoming data.
A promise that resolves to the validated Input data.
StaticenqueueEnqueues a job with the provided message, adding it to the job queue for future processing.
This static method allows jobs to be scheduled by adding the job name and the message to the queue.
The
Jobclass provides a structure for defining and processing background jobs with automatic validation.Each subclass must define a
dataclass, which extendsData<ObjectParser>, to represent the input structure.The
Jobclass will automatically instantiate thedataclass during validation using the providedObjectParser.Subclasses only need to define the
dataattribute and implement theperformmethod to process the job.Example