Add the notion of a node selector for routing

This commit is contained in:
Asim
2015-12-07 21:09:10 +00:00
parent 050fa26afb
commit 4e6b9347d9
4 changed files with 106 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ type options struct {
registry registry.Registry
transport transport.Transport
wrappers []Wrapper
selector NodeSelector
}
// Broker to be used for pub/sub
@@ -51,6 +52,13 @@ func Transport(t transport.Transport) Option {
}
}
// Selector is used to select a node to route a request to
func Selector(s NodeSelector) Option {
return func(o *options) {
o.selector = s
}
}
// Adds a Wrapper to a list of options passed into the client
func Wrap(w Wrapper) Option {
return func(o *options) {