GRPC C++  1.39.1
Public Types | Data Fields
grpc_core::LoadBalancingPolicy::PickResult Struct Reference

The result of picking a subchannel for a call. More...

#include <lb_policy.h>

Public Types

enum  ResultType { PICK_COMPLETE , PICK_QUEUE , PICK_FAILED }
 

Data Fields

ResultType type
 
RefCountedPtr< SubchannelInterfacesubchannel
 Used only if type is PICK_COMPLETE. More...
 
grpc_error_handle error = GRPC_ERROR_NONE
 Used only if type is PICK_FAILED. More...
 
std::function< void(grpc_error_handle, MetadataInterface *, CallState *)> recv_trailing_metadata_ready
 Used only if type is PICK_COMPLETE. More...
 

Detailed Description

The result of picking a subchannel for a call.

Member Enumeration Documentation

◆ ResultType

Enumerator
PICK_COMPLETE 

Pick complete.

If subchannel is non-null, the client channel will immediately proceed with the call on that subchannel; otherwise, it will drop the call.

PICK_QUEUE 

Pick cannot be completed until something changes on the control plane.

The client channel will queue the pick and try again the next time the picker is updated.

PICK_FAILED 

Pick failed.

If the call is wait_for_ready, the client channel will wait for the next picker and try again; otherwise, it will immediately fail the call with the status indicated via error (although the call may be retried if the client channel is configured to do so).

Field Documentation

◆ error

grpc_error_handle grpc_core::LoadBalancingPolicy::PickResult::error = GRPC_ERROR_NONE

Used only if type is PICK_FAILED.

Error to be set when returning a failure.

◆ recv_trailing_metadata_ready

std::function<void(grpc_error_handle, MetadataInterface*, CallState*)> grpc_core::LoadBalancingPolicy::PickResult::recv_trailing_metadata_ready

Used only if type is PICK_COMPLETE.

Callback set by LB policy to be notified of trailing metadata. If set by LB policy, the client channel will invoke the callback when trailing metadata is returned. The metadata may be modified by the callback. However, the callback does not take ownership, so any data that needs to be used after returning must be copied. The call state can be used to obtain backend metric data.

◆ subchannel

RefCountedPtr<SubchannelInterface> grpc_core::LoadBalancingPolicy::PickResult::subchannel

Used only if type is PICK_COMPLETE.

Will be set to the selected subchannel, or nullptr if the LB policy decides to drop the call.

◆ type

ResultType grpc_core::LoadBalancingPolicy::PickResult::type

The documentation for this struct was generated from the following file: