Develper Notes
Odd Job is a service that enables large processing tasks to be chuncked and run over a number of cycles.
Odd Jobs comprise of one or more server side javascripts with an expected set of methods and a configuration file.
//OpenForum/AddOn/OddJob/TestOddJob.sjs
function TestOddJob() {
var self = this;
var log;
self.setLog = function( newLog ) {
log = newLog;
};
self.setUp = function() {
log("TestOddJob setting up ");
};
self.tearDown = function() {
log("TestOddJob tearing down ");
};
self.process = function(data) {
log("TestOddJob processing "+data);
};
}
//OpenForum/AddOn/OddJob/odd-job.config.json{
"processors": [
{"page": "/OpenForum/AddOn/OddJob", "file": "TestOddJob.sjs"}
]
}
The configuration file may define a file containing the list to process eg. (the list should be in json format)
list: {
"pageName": "/OpenForum/AddOn/OddJob",
"fileName": "my-list.json"
}
×