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

Refactor Endpoint Builder #35

Open
ecton opened this issue Dec 13, 2021 · 0 comments
Open

Refactor Endpoint Builder #35

ecton opened this issue Dec 13, 2021 · 0 comments

Comments

@ecton
Copy link
Member

ecton commented Dec 13, 2021

The Endpoint Builder interface is not really friendly to use. Until the max_idle_timeout setting, I was using the simple new_server/new_client methods, but I can't use those simple methods in conjunction with the new configuration value.

The primary issue I have with the builder type is that it doesn't actually follow either of the common builder patterns -- the modification methods don't return self, preventing chaining the calls. This yielded a pretty ugly net diff:

khonsulabs/bonsaidb@2ee96a2

Ideally, these could be refactored into something like:

Endpoint::builder().server(port, keypair).max_idle_timeout(None).build()?
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

1 participant