aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/client_config/resolver_result.h
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2016-09-15 12:51:29 -0700
committerGravatar Mark D. Roth <roth@google.com>2016-09-15 12:51:29 -0700
commit1621c26c1ec49207e994e4b11671fb8fb38225ba (patch)
tree05ded84838d112c4901f23c999d42a7af197e2e6 /src/core/ext/client_config/resolver_result.h
parent1beb35b24b277598b9101f122de4cf8400973e96 (diff)
Allow resolver to pass channel args to LB policy.
Diffstat (limited to 'src/core/ext/client_config/resolver_result.h')
-rw-r--r--src/core/ext/client_config/resolver_result.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/core/ext/client_config/resolver_result.h b/src/core/ext/client_config/resolver_result.h
index fa60c8cc6d..821208f709 100644
--- a/src/core/ext/client_config/resolver_result.h
+++ b/src/core/ext/client_config/resolver_result.h
@@ -37,6 +37,16 @@
#include "src/core/ext/client_config/lb_policy.h"
#include "src/core/lib/iomgr/resolve_address.h"
+// TODO(roth, ctiller): In the long term, we are considering replacing
+// the resolver_result data structure with grpc_channel_args. The idea is
+// that the resolver will return a set of channel args that contains the
+// information that is currently in the resolver_result struct. For
+// example, there will be specific args indicating the set of addresses
+// and the name of the LB policy to instantiate. Note that if we did
+// this, we would probably want to change the data structure of
+// grpc_channel_args such to a hash table or AVL or some other data
+// structure that does not require linear search to find keys.
+
/// Used to represent addresses returned by the resolver.
typedef struct grpc_address {
grpc_resolved_address address;
@@ -63,9 +73,10 @@ void grpc_addresses_destroy(grpc_addresses* addresses);
/// Results reported from a grpc_resolver.
typedef struct grpc_resolver_result grpc_resolver_result;
-/// Takes ownership of \a addresses.
-grpc_resolver_result* grpc_resolver_result_create(grpc_addresses* addresses,
- const char* lb_policy_name);
+/// Takes ownership of \a addresses and \a lb_policy_args.
+grpc_resolver_result* grpc_resolver_result_create(
+ grpc_addresses* addresses, const char* lb_policy_name,
+ grpc_channel_args* lb_policy_args);
void grpc_resolver_result_ref(grpc_resolver_result* result);
void grpc_resolver_result_unref(grpc_exec_ctx* exec_ctx,
grpc_resolver_result* result);
@@ -78,4 +89,8 @@ grpc_addresses* grpc_resolver_result_get_addresses(
const char* grpc_resolver_result_get_lb_policy_name(
grpc_resolver_result* result);
+/// Caller does NOT take ownership of result.
+grpc_channel_args* grpc_resolver_result_get_lb_policy_args(
+ grpc_resolver_result* result);
+
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_RESULT_H */