code: function(jobid, taskid, config) { 
    if(!jobid || !taskid || !config) {
      throw Error('taskid/jobid missing');
    }
    if(!config.executable && !config.javascript) {
      throw Error("invalid executable/javascript. don't know what to run:"+taskid);
    }
    if(config.executable && config.javascript) {
      throw Error('only one of executable/javascript should be specified:'+taskid);
    }
    this.id = taskid;
    this.job = jobid;
    this.name = config.name || this.id;
    this.state = State.INIT;
    this.input = config.input || '';
    // these both are out params from the worker
    this.output = [];
    this.log=[];
    // information about the worker
    this.process = {};
    this.exec = config.executable;
    if(config.javascript) {
      this.jsfile = config.javascript.lib;
      this.methodName = config.javascript.method || 'task';
      if(!this._isJSModulePresent(this.jsfile, this.methodName)) {
        throw Error('given method:'+ this.methodName + ' not found in jsfile:' + this.jsfile);
      }
    }
  }
docs: /*
  Only either 'cmd' or jsfile to be passed. Priority would be given to cmd.