node package manager

ee-retry

Repeat some action in an exponential increased capped interval

ee-retry

Repeat some action in an exponential increased capped interval

npm install ee-retry

var Retry = require( "ee-retry" );

var try = new Retry( {
   	  min: 100 // 0.1 sec
	, max: 60000 // 1 minute
} );


try.on( "try", function( stop ){
	// execute somthing
	var connection = new Connection();
	connection.on( "connect", function(){
		// call the finished function
		stop();
	} );
} );