|
int | S_OK = 0 |
|
int | S_BAD = 1 |
|
Definition at line 23 of file ConnectionPool.py.
◆ close()
◆ connects()
get the number of existing connections
:return: the number of connections
Definition at line 256 of file ConnectionPool.py.
◆ get_connection()
def get_connection |
( |
|
self | ) |
|
◆ get_ok_servers_num()
def get_ok_servers_num |
( |
|
self | ) |
|
◆ get_session()
def get_session |
( |
|
self, |
|
|
|
user_name, |
|
|
|
password, |
|
|
|
retry_connect = True |
|
) |
| |
get session
:param user_name: the user name to authenticate graphd
:param password: the password to authenticate graphd
:param retry_connect:
:return: Session
Definition at line 103 of file ConnectionPool.py.
◆ in_used_connects()
def in_used_connects |
( |
|
self | ) |
|
get the number of the used connections
:return: int
Definition at line 267 of file ConnectionPool.py.
◆ init()
def init |
( |
|
self, |
|
|
|
addresses, |
|
|
|
configs = None , |
|
|
|
ssl_conf = None |
|
) |
| |
init the connection pool
:param addresses: the graphd servers' addresses
:param configs: the config of the pool
:param ssl_conf: the config of SSL socket
:return: if all addresses are ok, return True else return False.
Definition at line 45 of file ConnectionPool.py.
◆ ping()
def ping |
( |
|
self, |
|
|
|
address |
|
) |
| |
check the server is ok
:param address: the server address want to connect
:return: True or False
Definition at line 216 of file ConnectionPool.py.
◆ session_context()
def session_context |
( |
|
self, |
|
|
* |
args, |
|
|
** |
kwargs |
|
) |
| |
session_context is to be used with a contextlib.contextmanager.
It returns a connection session from the pool, with same params
as the method get_session().
When session_context is exited, the connection will be released.
:param user_name: the user name to authenticate graphd
:param password: the password to authenticate graphd
:param retry_connect: if auto retry connect
:return: contextlib._GeneratorContextManager
Definition at line 121 of file ConnectionPool.py.
◆ update_servers_status()
def update_servers_status |
( |
|
self | ) |
|
The documentation for this class was generated from the following file: