Using classes to define jobs?
See original GitHub issueI would like to know if it is possible to create a job as a class. For instance, would something like this be possible?
class SendNotificationMails extends someBaseJobClass {
constructor() {
this.attach("notification-mails", /*... other settings */)
}
async run() {
// Execute job...
}
}
It would make organizing a lot of background jobs much easier to write everything in classes and just have them register at an initial script.
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (9 by maintainers)
Top Results From Across the Web
Job Class Definition | Law Insider
Job Class refers to a group of jobs specified in Schedule "A" whose common characteristic is a specific point range and corresponding standard...
Read more >Controlling the use of job names and job classes - IBM
Controlling the use of job names and job classes. You can use profiles in the JESJOBS class to control which job names and...
Read more >Classes in Python: Definition and Examples (Plus Objects)
In Python, you use classes as schematics that define an object within the program's code, representing a group of data and functions.
Read more >Working Class Explained: Definition, Compensation, Job ...
While "working class" is typically associated with manual labor and limited education, blue collar workers are vital to every economy.
Read more >Specify Job Classes and Number of Initiators - TechDocs
For some job types, you can also specify a job class in a job definition. To find out which verbs and subverbs you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you are looking for another example of a wrapping method, here’s how Actionhero takes it’s Task classes and structures them into the node-resque methods https://github.com/actionhero/actionhero/blob/3f9d936000d44afffd8798f1c3f5a3cb872390d2/src/initializers/tasks.ts#L62-L134
I ended up creating this wrapper: