Add server state helper functions
Added helper functions that check various server states. This makes the readwritesplit code easier to read as the function names convey the intention better than the macro invokations.
This commit is contained in:
@ -219,6 +219,27 @@ public:
|
||||
*/
|
||||
bool is_closed() const;
|
||||
|
||||
/**
|
||||
* @brief Check if the server is a master
|
||||
*
|
||||
* @return True if server is a master
|
||||
*/
|
||||
bool is_master() const;
|
||||
|
||||
/**
|
||||
* @brief Check if the server is a slave
|
||||
*
|
||||
* @return True if the server is a slave
|
||||
*/
|
||||
bool is_slave() const;
|
||||
|
||||
/**
|
||||
* @brief Check if the server is a relay server
|
||||
*
|
||||
* @return True if the server is a relay server
|
||||
*/
|
||||
bool is_relay() const;
|
||||
|
||||
/**
|
||||
* @brief Check if the backend has failed fatally
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user