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

Improve shared streams interfaces #1472

Open
3 tasks
mateiidavid opened this issue Apr 19, 2024 · 0 comments
Open
3 tasks

Improve shared streams interfaces #1472

mateiidavid opened this issue Apr 19, 2024 · 0 comments
Labels
runtime controller runtime related unstable feature that unstable feature gating

Comments

@mateiidavid
Copy link
Contributor

Would you like to work on this feature?

yes

What problem are you trying to solve?

We added experimental support for shared stream interfaces in PR #1449. Although the change is code complete, it has some rough edges.

Improvements

  • Introduce a new type to do writes against the store.

    • All writes on a store are handled through Writer<K>. There are two different types of writers: those that are backed by a channel (and can distribute events to listeners) and those that are not. We should differentiate between these two different contracts by introducing an appropriate type for a "shared" writer. This will allow us to avoid awkward public interface, like the subscribe() method
  • Return a concrete type that implements Stream from reflector().

    • It would be good to try and change the type returned by a reflector(). Because a writer can now broadcast events to listeners, it has to call into an async function when a watcher stream is threaded through it. To keep it simple, we are using the stream! macro, but it tends to obfuscate the implementation. It would be nicer to deal with a concrete type here (which in turn might make subscribing easier)
  • Shared streams Controller interfaces for relations (watches_shared_stream and owns_shared_stream)

    • We should extend for_shared_stream in such a way that Controllers may accept shared streams for owned objects.

Parts of this have already been mentioned as future work in #1080.

Describe the solution you'd like

N/A

Describe alternatives you've considered

N/A

Documentation, Adoption, Migration Strategy

No response

Target crate for feature

kube-runtime

@clux clux added runtime controller runtime related unstable feature that unstable feature gating labels Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
runtime controller runtime related unstable feature that unstable feature gating
Projects
None yet
Development

No branches or pull requests

2 participants