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

expose a less copy-heavy interface from Reflector #60

Closed
clux opened this issue Aug 11, 2019 · 1 comment
Closed

expose a less copy-heavy interface from Reflector #60

clux opened this issue Aug 11, 2019 · 1 comment
Labels
help wanted Not immediately prioritised, please help!

Comments

@clux
Copy link
Member

clux commented Aug 11, 2019

Currently all Reflector::read calls do a full copy:

https://github.com/clux/kube-rs/blob/3b14161baefe64ba308344e886b186aa4fbb0c7f/src/api/reflector.rs#L133-L149

this is probably not what all users want (see #57).

Alternatives so far:

  • wrap self.cache in an Arc and hand out clones of that
  • make read be the equivalent of into_iter and expose an alternative iter equivalent

The first sounds tricky to get right depending on how people drive the reflector (borrow-checking might get harder to satisfy) when one thread polls and other threads want to read. Attempts at making this better is welcome.

@clux clux added help wanted Not immediately prioritised, please help! enhancement labels Aug 11, 2019
clux added a commit that referenced this issue Aug 26, 2019
@clux
Copy link
Member Author

clux commented Nov 30, 2019

Well, this was done in the linked commit really. Closing for now until there's an actual issue with that interface.

@clux clux closed this as completed Nov 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Not immediately prioritised, please help!
Projects
None yet
Development

No branches or pull requests

1 participant