Hazelcast C++ Client
Public Types | Public Member Functions | List of all members
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.

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

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

◆ 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.

◆ 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

◆ 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

◆ 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

◆ 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

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