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

example: load_balancing #2504

Merged
merged 7 commits into from
Dec 27, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
comments and things
  • Loading branch information
menghanl committed Dec 21, 2018
commit ba6540a9ad36deaf347ff6e432fc72f1ab39abb7
6 changes: 5 additions & 1 deletion examples/features/load_balancing/README.md
Original file line number Diff line number Diff line change
@@ -25,7 +25,11 @@ with `this is examples/load_balancing (from :50051)`.
Two clients are created, to connect to both of these servers (they get both
server addresses from the name resolver).

Each client picks a different load balancer (using `grpc.WithBalancerName`).
Each client picks a different load balancer (using `grpc.WithBalancerName`):
`pick_first` or `round_robin`. (These two policies are supported in gRPC by
default. To add a custom balancing policy, implement the interfaces defined in
https://godoc.org/google.golang.org/grpc/balancer).

Note that balancers can also be switched using service config, which allows
service owners (instead of client owners) to pick the balancer to use. Service
config doc is available at
1 change: 1 addition & 0 deletions examples/features/load_balancing/client/main.go
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
*
*/

// Binary client is an example client.
package main
menghanl marked this conversation as resolved.
Show resolved Hide resolved

import (
1 change: 1 addition & 0 deletions examples/features/load_balancing/server/main.go
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
*
*/

// Binary server is an example server.
package main
menghanl marked this conversation as resolved.
Show resolved Hide resolved

import (