package gracefulswitch
Import Path
google.golang.org/grpc/internal/balancer/gracefulswitch (on go.dev)
Dependency Relation
imports 9 packages, and imported by one package
Package-Level Type Names (only one)
Balancer is a utility to gracefully switch from one balancer to
a new balancer. It implements the balancer.Balancer interface.
Close closes any active child balancers.
ExitIdle forwards the call to the latest balancer created.
If the latest balancer does not support ExitIdle, the subConns are
re-connected to manually.
ResolverError forwards the error to the latest balancer created.
SwitchTo initializes the graceful switch process, which completes based on
connectivity state changes on the current/pending balancer. Thus, the switch
process is not complete when this method returns. This method must be called
synchronously alongside the rest of the balancer.Balancer methods this
Graceful Switch Balancer implements.
Deprecated: use ParseConfig and pass a parsed config to UpdateClientConnState
to cause the Balancer to automatically change to the new child when necessary.
UpdateClientConnState forwards the update to the latest balancer created.
If the state's BalancerConfig is the config returned by a call to
gracefulswitch.ParseConfig, then this function will automatically SwitchTo
the balancer indicated by the config before forwarding its config to it, if
necessary.
UpdateSubConnState forwards the update to the appropriate child.
*Balancer : google.golang.org/grpc/balancer.Balancer
*Balancer : google.golang.org/grpc/balancer.ExitIdler
*Balancer : google.golang.org/grpc/balancer/endpointsharding.ExitIdler
func NewBalancer(cc balancer.ClientConn, opts balancer.BuildOptions) *Balancer
Package-Level Functions (total 3)
ChildName returns the name of the child balancer of the gracefulswitch
Balancer.
NewBalancer returns a graceful switch Balancer.
ParseConfig parses a child config list and returns a LB config for the
gracefulswitch Balancer.
cfg is expected to be a json.RawMessage containing a JSON array of LB policy
names + configs as the format of the "loadBalancingConfig" field in
ServiceConfig. It returns a type that should be passed to
UpdateClientConnState in the BalancerConfig field.
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |