resilient-http / resilient.js

Fault tolerant and reactive HTTP client for node.js and browsers
183 stars 13 forks source link

Allow to override retries option on resilient#send and rest of methods. #135

Open ismriv opened 8 years ago

ismriv commented 8 years ago

I've come across certain use cases where I would like to override the number of retries, configured in the client, on very specific requests, like in the following example, without having to create a new client instance:

client.send(path, {retry: 0, ...}, callback);

If this is currently possible, I didn't manage to get it right ... would this be a reasonable feature to add to resilient.js?

h2non commented 8 years ago

Yes, it can be achieved easily. Send method can support vadiadic arguments and infer them based of their type.

h2non commented 8 years ago

@ismriv are you able to provide a PR? Otherwise I can support it in a near future.

ismriv commented 8 years ago

Sure, I'll try to provide a PR by the end of the week.