Hazelcast C++ Client
Hazelcast C++ Client Library
hazelcast::client::load_balancer Class Referencefinal

load_balancer allows you to send operations to one of a number of endpoints(Members). More...

#include <load_balancer.h>

Public Member Functions

template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
load_balancerinit (Handler &&h) &
 Sets the function to be called when load balancer is initialized. More...
 
template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
load_balancer && init (Handler &&h) &&
 
template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
load_balancernext (Handler &&h) &
 The function returns the next member to route to. More...
 
template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
load_balancer && next (Handler &&h) &&
 

Friends

class connection::ClientConnectionManagerImpl
 

Detailed Description

load_balancer allows you to send operations to one of a number of endpoints(Members).

It is up to the implementation to use different load balancing policies. If Client is configured as smart, only the operations that are not key based will be router to the endpoint returned by the Load Balancer. If it is not smart, load_balancer will not be used. Note: Client is smart by default.

Definition at line 37 of file load_balancer.h.

Member Function Documentation

◆ init()

template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
load_balancer& hazelcast::client::load_balancer::init ( Handler &&  h) &
inline

Sets the function to be called when load balancer is initialized.

Parameters
clusterCluster contains current membership information for initialization. And one can add membership through this class for future notifications.

Definition at line 47 of file load_balancer.h.

47  {
48  init_ = std::forward<Handler>(h);
49  return *this;
50  }

◆ next()

template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
load_balancer& hazelcast::client::load_balancer::next ( Handler &&  h) &
inline

The function returns the next member to route to.

Parameters
hThe function to be used for finding the next member.

Definition at line 66 of file load_balancer.h.

66  {
67  next_ = std::forward<Handler>(h);
68  return *this;
69  }

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