envoyproxy / envoyproxy/go-control-plane

Move the cache watch API from channels to interfaces

Open
#509 4 comments 2 reactions 0 assignees View on GitHub
no stalebot
Dominant language
Go
Stars
1.7k
Forks
567
Avg merge
15h 46m
Merged PRs (30d)
11

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.