Add ChannelArguments::SetLoadBalancingPolicyName() to C++ API.

pull/8523/head
Mark D. Roth 8 years ago
parent d4a5971ae8
commit 7190b0c651
  1. 5
      include/grpc++/support/channel_arguments.h
  2. 5
      src/cpp/common/channel_arguments.cc

@ -80,6 +80,11 @@ class ChannelArguments {
/// The given string will be sent at the front of the user agent string.
void SetUserAgentPrefix(const grpc::string& user_agent_prefix);
// Set LB policy name.
// Note that if the name resolver returns only balancer addresses, the
// grpclb LB policy will be used, regardless of what is specified here.
void SetLoadBalancingPolicyName(const grpc::string& lb_policy_name);
// Generic channel argument setters. Only for advanced use cases.
/// Set an integer argument \a value under \a key.
void SetInt(const grpc::string& key, int value);

@ -113,6 +113,11 @@ void ChannelArguments::SetUserAgentPrefix(
}
}
void ChannelArguments::SetLoadBalancingPolicyName(
const grpc::string& lb_policy_name) {
SetString(GRPC_ARG_LB_POLICY_NAME, lb_policy_name);
}
void ChannelArguments::SetInt(const grpc::string& key, int value) {
grpc_arg arg;
arg.type = GRPC_ARG_INTEGER;

Loading…
Cancel
Save