-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Has push model been considered for discovery API? #475
Comments
I made a spike once, but it didn't work out, for reasons that escape me right now. I'd be happy to take a PR. It's important that the interface and its behaviors are kept consistent across implementations. |
@peterbourgon I can try doing a PR. However, there are a few points we should agree on first.
type Discoverer interface {
Instances() []string
}
type Notifier interface {
Register(chan<- []string)
Unregister(chan<- []string)
} |
Did some prototyping, have to go with |
I guess this is done now :) |
We have an internal service discovery that supports server push when service instances are added/removed. The current Subscriber interface is inherently pull-based, which works with the assumption that load balancer always asks for available endpoints for every RPC call, but that's not how some RPC frameworks are implemented, e.g. in TChannel I can update the Peers in the connection object, but connection never asks for them itself. Currently the only way to use sd.Subscriber with such connection is to have some bg loop that polls it periodically.
If I am not mistaken, the sd.zk.Subscriber is also based on the push model internally, so it would be good to expose push model via the top level interface.
The text was updated successfully, but these errors were encountered: