MCPcopy
hub / github.com/redis/redis-py / ping

Method ping

redis/client.py:1485–1493  ·  view source on GitHub ↗

Ping the Redis server to test connectivity. Sends a PING command to the Redis server and returns True if the server responds with "PONG".

(self, message: Union[str, None] = None)

Source from the content-addressed store, hash-verified

1483 get_sharded_message = get_message
1484
1485 def ping(self, message: Union[str, None] = None) -> bool:
1486 """
1487 Ping the Redis server to test connectivity.
1488
1489 Sends a PING command to the Redis server and returns True if the server
1490 responds with "PONG".
1491 """
1492 args = ["PING", message] if message is not None else ["PING"]
1493 return self.execute_command(*args)
1494
1495 def handle_message(self, response, ignore_subscribe_messages=False):
1496 """

Calls 1

execute_commandMethod · 0.95