Available connections and used connections
List of connections available in _available_connections Total number of connections created so far with _created_connections _in_use_connection sets the connection you are currently using
If there is a connection that can be used from _available_connections with the get_connection method, it will be fetched by pop. If not, create a new connection with make_connection and add it to _in_use_connection
Return the connection to pook with the release method. (remove from _in_use_connection, _available_connections and append)
Open the pool with disconnect
How it is actually used
In the execute_command method of the StrictRedis class Get connection from pool with get_connection method Execute a command using a connection, and if the command execution ends normally or abnormally, return a connection with (finally) release (in the case of an abnormality, discard the connection from the pool and create a new connection)
Huh
Recommended Posts