lib/controllers/retry.js
function Retry(conf) {
  component.Component.call(this, 'controller', conf);
  this.registerGearman(conf.servers, {
    client: true,
    worker: {
      func_name: 'retryController',
      func: _.bind( function(json_string, worker) {
        try {
          // TODO: this parsing and meta parameter storing should be encapsulated into a Task class
          var task = JSON.parse( json_string.toString() );
          task._task_json_string = json_string;
          task._task_worker = worker;

          this.execute_task( task );
        }
        catch ( e ) {
          _err( 'Error executing retryController with following payload:', json_string );
        }
      }, this )
    }
  });
}
function Retry(conf) {
  component.Component.call(this, 'controller', conf);
  this.registerGearman(conf.servers, {
    client: true,
    worker: {
      func_name: 'retryController',
      func: _.bind( function(json_string, worker) {
        try {
          // TODO: this parsing and meta parameter storing should be encapsulated into a Task class
          var task = JSON.parse( json_string.toString() );
          task._task_json_string = json_string;
          task._task_worker = worker;

          this.execute_task( task );
        }
        catch ( e ) {
          _err( 'Error executing retryController with following payload:', json_string );
        }
      }, this )
    }
  });
}
function Retry ( conf ) { component . Component . call ( this , 'controller' , conf ) ; this . registerGearman ( conf . servers , { client : true , worker : { func_name : 'retryController' , func : _ . bind ( function ( json_string , worker ) { try { // TODO: this parsing and meta parameter storing should be encapsulated into a Task class var task = JSON . parse ( json_string . toString ( ) ) ; task . _task_json_string = json_string ; task . _task_worker = worker ; this . execute_task ( task ) ; } catch ( e ) { _err ( 'Error executing retryController with following payload:' , json_string ) ; } } , this ) } } ) ; }
Retry component. Emits 'connect' when at least one server for both
worker and client roles are connected to.
Retry component . Emits connect when at least one server for both worker and client roles are connected to .