1.10.0 • Published 3 years ago

retry-again v1.10.0

Weekly downloads
6
License
ISC
Repository
github
Last release
3 years ago

retry-again

Retry function execution N ms later, controlled by try/catch error events, just new Retry(funct)

  const payload = function(){

    throw new Error('Man yells at clouds!');

  }

  // npm i retry-again
  const Retry = require('retry-again');
  new Retry(payload);
  new Retry(payload, {count:2, delay:10});

  // awaits ms
  // retry error Man yells at clouds!
  // retry again still error Man yells at clouds!
  // give up

  //Note: execution will begin with .ms delay, thus use this way for 3 retries.
  try{
    sendMessage();
  }catch(e){
   new Retry(sendMessage, {count:2, delay:10}); // a total of 3 tries.
  }
1.10.0

3 years ago

1.9.0

5 years ago

1.8.0

5 years ago

1.7.0

6 years ago

1.6.0

6 years ago

1.5.0

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago