|
|
@ -142,15 +142,18 @@ void grpc_lb_policy_weak_unref(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy); |
|
|
|
void grpc_lb_policy_init(grpc_lb_policy *policy, |
|
|
|
void grpc_lb_policy_init(grpc_lb_policy *policy, |
|
|
|
const grpc_lb_policy_vtable *vtable); |
|
|
|
const grpc_lb_policy_vtable *vtable); |
|
|
|
|
|
|
|
|
|
|
|
/** Find an appropriate target for this call, based on \a pick_args.
|
|
|
|
/** Finds an appropriate subchannel for a call, based on \a pick_args.
|
|
|
|
Picking can be synchronous or asynchronous. In the synchronous case, when a |
|
|
|
|
|
|
|
pick is readily available, it'll be returned in \a target and a non-zero |
|
|
|
\a target will be set to the selected subchannel, or NULL on failure. |
|
|
|
value will be returned. |
|
|
|
Upon success, \a user_data will be set to whatever opaque information |
|
|
|
In the asynchronous case, zero is returned and \a on_complete will be called |
|
|
|
may need to be propagated from the LB policy, or NULL if not needed. |
|
|
|
once \a target and \a user_data have been set. Any IO should be done under |
|
|
|
|
|
|
|
\a pick_args->pollent. The opaque \a user_data output argument corresponds |
|
|
|
If the pick succeeds and a result is known immediately, a non-zero |
|
|
|
to information that may need be propagated from the LB policy. It may be |
|
|
|
value will be returned. Otherwise, \a on_complete will be invoked |
|
|
|
NULL. Errors are signaled by receiving a NULL \a *target. */ |
|
|
|
once the pick is complete with its error argument set to indicate |
|
|
|
|
|
|
|
success or failure. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Any I/O should be done under \a pick_args->pollent. */ |
|
|
|
int grpc_lb_policy_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy, |
|
|
|
int grpc_lb_policy_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy, |
|
|
|
const grpc_lb_policy_pick_args *pick_args, |
|
|
|
const grpc_lb_policy_pick_args *pick_args, |
|
|
|
grpc_connected_subchannel **target, void **user_data, |
|
|
|
grpc_connected_subchannel **target, void **user_data, |
|
|
|