Hazelcast C++ Client
Hazelcast C++ Client Library
hazelcast::client::config::client_connection_strategy_config Class Reference

Client connection strategy configuration is used for setting custom strategies and configuring strategy parameters. More...

#include <client_connection_strategy_config.h>

Public Types

enum  reconnect_mode { OFF , ON , ASYNC }
 Reconnect options. More...
 

Public Member Functions

bool is_async_start () const
 Client instance creation won't block on hazelcast_client(ClientConfig &) if this value is true. More...
 
client_connection_strategy_configset_async_start (bool async_start)
 Set true for non blocking hazelcast_client(const client_config &). More...
 
reconnect_mode get_reconnect_mode () const
 
client_connection_strategy_configset_reconnect_mode (reconnect_mode reconnect_mode)
 How a client reconnect to cluster after a disconnect can be configured. More...
 
connection_retry_configget_retry_config ()
 connection_retry_config controls the period among the retries and when a client should give up retrying. More...
 
client_connection_strategy_configset_retry_config (connection_retry_config retry_config)
 connection_retry_config controls the period among the retries and when a client should give up retrying. More...
 

Detailed Description

Client connection strategy configuration is used for setting custom strategies and configuring strategy parameters.

Definition at line 32 of file client_connection_strategy_config.h.

Member Enumeration Documentation

◆ reconnect_mode

Reconnect options.

Enumerator
OFF 

Prevent reconnect to cluster after a disconnect.

ON 

Reconnect to cluster by blocking invocations.

ASYNC 

Reconnect to cluster without blocking invocations.

Invocations will receive hazelcast_client_offline

Definition at line 39 of file client_connection_strategy_config.h.

39  {
43  OFF,
47  ON,
52  ASYNC
53  };

Member Function Documentation

◆ get_reconnect_mode()

client_connection_strategy_config::reconnect_mode hazelcast::client::config::client_connection_strategy_config::get_reconnect_mode ( ) const
Returns
reconnect mode

Definition at line 324 of file config.cpp.

324  {
325  return reconnect_mode_;
326  }

◆ get_retry_config()

connection_retry_config & hazelcast::client::config::client_connection_strategy_config::get_retry_config ( )

connection_retry_config controls the period among the retries and when a client should give up retrying.

Exponential behaviour can be chosen or jitter can be added to wait periods.

Returns
connection_retry_config the connection retry config to read or modify.

Definition at line 343 of file config.cpp.

343  {
344  return retry_config_;
345  }

◆ is_async_start()

bool hazelcast::client::config::client_connection_strategy_config::is_async_start ( ) const

Client instance creation won't block on hazelcast_client(ClientConfig &) if this value is true.

Returns
if client connects to cluster asynchronously

Definition at line 328 of file config.cpp.

328  {
329  return async_start_;
330  }

◆ set_async_start()

client_connection_strategy_config & hazelcast::client::config::client_connection_strategy_config::set_async_start ( bool  async_start)

Set true for non blocking hazelcast_client(const client_config &).

The client creation won't wait to connect to cluster. The client instace will throw exception until it connects to cluster and become ready. If set to false, hazelcast_client(const client_config &) will block until a cluster connection established and it's ready to use client instance

default value is false

Parameters
asyncStarttrue for async client creation
Returns
the updated ClientConnectionStrategyConfig

Definition at line 332 of file config.cpp.

332  {
333  this->async_start_ = async_start;
334  return *this;
335  }

◆ set_reconnect_mode()

client_connection_strategy_config & hazelcast::client::config::client_connection_strategy_config::set_reconnect_mode ( reconnect_mode  reconnect_mode)

How a client reconnect to cluster after a disconnect can be configured.

This parameter is used by default strategy and custom implementations may ignore it if configured. default value is ReconnectMode#ON

Parameters
reconnectMode
Returns
the updated ClientConnectionStrategyConfig

Definition at line 338 of file config.cpp.

338  {
339  this->reconnect_mode_ = reconnect_mode;
340  return *this;
341  }

◆ set_retry_config()

client_connection_strategy_config & hazelcast::client::config::client_connection_strategy_config::set_retry_config ( connection_retry_config  retry_config)

connection_retry_config controls the period among the retries and when a client should give up retrying.

Exponential behaviour can be chosen or jitter can be added to wait periods.

Parameters
connection_retry_configthe connection retry config to read or modify.
Returns
the updated client_connection_strategy_config

Definition at line 348 of file config.cpp.

348  {
349  retry_config_ = std::move(retry_config);
350  return *this;
351  }

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