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

Move the cache watch API from channels to interfaces #509

Open
jpeach opened this issue Oct 21, 2021 · 4 comments
Open

Move the cache watch API from channels to interfaces #509

jpeach opened this issue Oct 21, 2021 · 4 comments

Comments

@jpeach
Copy link
Contributor

jpeach commented Oct 21, 2021

When you register a watch on a cache entry using CreateWatch the caller has to pass in a channel to receive the notification. This approach makes both the caller and the cache responsible for channel buffer management (i.e. it will deadlock if the buffer fiils), and precludes notification designs that aren't channels (e.g. appending to a queue).

Consider changing the API to allow the caller to pass in a notification interface. This means that if a caller chooses to implement notifications using channels it can, and the cache doesn't need to care about that. If a caller needs a different kind of notification, it can do that too.

UInfortunately, this would break everyone's code, so needs some thought about migration and perhaps a default implementation.

xref #503

@alecholmez
Copy link
Contributor

I like the thought @jpeach. Can you drop a comment here with what the notification interface might look like?

@jpeach
Copy link
Contributor Author

jpeach commented Oct 27, 2021

I like the thought @jpeach. Can you drop a comment here with what the notification interface might look like?

Sure, probably next week. In the slack commentary someone mentioned that the Java xDS library used a notification interface, so it might be worth following that.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Nov 27, 2021
@github-actions
Copy link

github-actions bot commented Dec 4, 2021

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

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

No branches or pull requests

2 participants