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

Prefetch options for etcd and Consul #22

Merged
merged 5 commits into from
Apr 19, 2018
Merged

Prefetch options for etcd and Consul #22

merged 5 commits into from
Apr 19, 2018

Conversation

asdine
Copy link
Contributor

@asdine asdine commented Apr 19, 2018

This PR adds a prefetch option for etcd and Consul that makes them fetch the entire subtree, cache it and use the cache to serve the keys to Confita without additional network round trips.
Fixes #10

return func(b *Backend) {
b.prefetch = true
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code related to the Option type should be moved somewhere else. It seems to be duplicated from the consul package.
WDYT ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📖 A little copying is better than a little dependency.

Basically, moving the Option system out of the backends would mean:

  • tight coupling between them
  • having one backend struct shared between all the backends
  • having to export the fields ex: prefetch -> Prefetch
  • having options that only make sense in one backend but not another, but being able to pass them anyway
  • and so on

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't aware about this video. Thanks ❤️

@asdine asdine merged commit 6505252 into master Apr 19, 2018
@asdine asdine deleted the batch branch April 19, 2018 16:36
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

Successfully merging this pull request may close these issues.

3 participants