GRPC Core  0.11.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs | Functions
lb_policy.h File Reference
#include "src/core/client_config/subchannel.h"

Go to the source code of this file.

Data Structures

struct  grpc_lb_policy
 
struct  grpc_lb_policy_vtable
 

Macros

#define GRPC_LB_POLICY_REF(p, r)   grpc_lb_policy_ref((p))
 
#define GRPC_LB_POLICY_UNREF(p, r)   grpc_lb_policy_unref((p))
 

Typedefs

typedef struct grpc_lb_policy grpc_lb_policy
 A load balancing policy: specified by a vtable and a struct (which is expected to be extended to contain some parameters) More...
 
typedef struct
grpc_lb_policy_vtable 
grpc_lb_policy_vtable
 
typedef void(* grpc_lb_completion )(void *cb_arg, grpc_subchannel *subchannel, grpc_status_code status, const char *errmsg)
 

Functions

void grpc_lb_policy_ref (grpc_lb_policy *policy)
 
void grpc_lb_policy_unref (grpc_lb_policy *policy)
 
void grpc_lb_policy_init (grpc_lb_policy *policy, const grpc_lb_policy_vtable *vtable)
 called by concrete implementations to initialize the base struct More...
 
void grpc_lb_policy_shutdown (grpc_lb_policy *policy)
 Start shutting down (fail any pending picks) More...
 
void grpc_lb_policy_pick (grpc_lb_policy *policy, grpc_pollset *pollset, grpc_metadata_batch *initial_metadata, grpc_subchannel **target, grpc_iomgr_closure *on_complete)
 Given initial metadata in initial_metadata, find an appropriate target for this rpc, and 'return' it by calling on_complete after setting target. More...
 
void grpc_lb_policy_broadcast (grpc_lb_policy *policy, grpc_transport_op *op)
 
void grpc_lb_policy_exit_idle (grpc_lb_policy *policy)
 
void grpc_lb_policy_notify_on_state_change (grpc_lb_policy *policy, grpc_connectivity_state *state, grpc_iomgr_closure *closure)
 
grpc_connectivity_state grpc_lb_policy_check_connectivity (grpc_lb_policy *policy)
 

Macro Definition Documentation

#define GRPC_LB_POLICY_REF (   p,
 
)    grpc_lb_policy_ref((p))
#define GRPC_LB_POLICY_UNREF (   p,
 
)    grpc_lb_policy_unref((p))

Typedef Documentation

typedef void(* grpc_lb_completion)(void *cb_arg, grpc_subchannel *subchannel, grpc_status_code status, const char *errmsg)

A load balancing policy: specified by a vtable and a struct (which is expected to be extended to contain some parameters)

Function Documentation

void grpc_lb_policy_broadcast ( grpc_lb_policy policy,
grpc_transport_op op 
)
grpc_connectivity_state grpc_lb_policy_check_connectivity ( grpc_lb_policy policy)
void grpc_lb_policy_exit_idle ( grpc_lb_policy policy)
void grpc_lb_policy_init ( grpc_lb_policy policy,
const grpc_lb_policy_vtable vtable 
)

called by concrete implementations to initialize the base struct

void grpc_lb_policy_notify_on_state_change ( grpc_lb_policy policy,
grpc_connectivity_state state,
grpc_iomgr_closure closure 
)
void grpc_lb_policy_pick ( grpc_lb_policy policy,
grpc_pollset pollset,
grpc_metadata_batch initial_metadata,
grpc_subchannel **  target,
grpc_iomgr_closure on_complete 
)

Given initial metadata in initial_metadata, find an appropriate target for this rpc, and 'return' it by calling on_complete after setting target.

Picking can be asynchronous. Any IO should be done under pollset.

void grpc_lb_policy_ref ( grpc_lb_policy policy)
void grpc_lb_policy_shutdown ( grpc_lb_policy policy)

Start shutting down (fail any pending picks)

void grpc_lb_policy_unref ( grpc_lb_policy policy)