Closed over-star closed 6 years ago
According to the Predis documentation:
Connections to Redis are lazy meaning that the client connects to a server only if and when needed. While it is recommended to let the client do its own stuff under the hood, there may be times when it is still desired to have control of when the connection is opened or closed: this can easily be achieved by invoking $client->connect() and $client->disconnect()
Normally, the client won't connect to Sentinel/Redis until we execute a command, and we don't need to check each time. The client manages this for us. That said, we can check if the client is connected:
$connected = app('redis-sentinel')->connection('name')->client()->isConnected();
...or simply:
$connected = app('redis-sentinel')->isConnected();
Predis generally follows this process to establish a connection when we execute a Redis command:
has been star,thanks very mush !
Thanks! I'm going to close this ticket now, but please let me know if you need more information.
i want to know that the sentinel is first connected with each connection?then connect redis? I want to know the specific process of connection,please tell me