Abstract
Protected
Abstract
Readonly
dataThe Data
class for this job, which is used for validation. Must be
defined by subclasses.
Abstract
performAbstract 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.
Static
enqueue
The
Job
class provides a structure for defining and processing background jobs with automatic validation.Each subclass must define a
data
class, which extendsData<ObjectParser>
, to represent the input structure.The
Job
class will automatically instantiate thedata
class during validation using the providedObjectParser
.Subclasses only need to define the
data
attribute and implement theperform
method to process the job.Example