Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functional Options support #31

Closed
italolelis opened this issue Apr 24, 2018 · 2 comments
Closed

Functional Options support #31

italolelis opened this issue Apr 24, 2018 · 2 comments

Comments

@italolelis
Copy link
Contributor

italolelis commented Apr 24, 2018

Hello,

Thank you a lot for this amazing library, it's really useful and well thought.
How would you feel about supporting function options? Something like this:

hystrixClient := heimdall.NewHystrixHTTPClient(
	timeout,
	heimdall.WithCommandName("MyCommand"),
	heimdall.WithHystrixTimeout(1100),
	heimdall.WithMaxConcurrentRequests(100),
	heimdall.WithErrorPercentThreshold(25),
	heimdall.WithSleepWindow(10),
	heimdall.WithRequestVolumeThreshold(10),
    heimdall.WithHystrixRetryCount(2),
	heimdall.WithHystrixRetrier(heimdall.NewRetrier(heimdall.NewConstantBackoff(10, 5))),
)

Is this something you'd like to see in the lib? If yes I can send a PR with it.

Thanks again!

@rShetty
Copy link
Contributor

rShetty commented Apr 30, 2018

Hey @italolelis I think it makes sense. Can you go ahead with the PR

@italolelis
Copy link
Contributor Author

Closing this issue as #33 is already merged 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants