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

Method try_read

redis/client.py:1251–1265  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1249 self.check_health()
1250
1251 def try_read():
1252 if not block:
1253 if not conn.can_read(timeout=timeout):
1254 return None
1255 read_timeout = timeout
1256 else:
1257 conn.connect()
1258 # Block indefinitely waiting for a pubsub message. timeout=None
1259 # makes the socket layer call sock.settimeout(None) for this read
1260 # (and restore the original socket_timeout afterwards), so the
1261 # configured socket_timeout does not abort the read.
1262 read_timeout = None
1263 return conn.read_response(
1264 disconnect_on_error=False, push_request=True, timeout=read_timeout
1265 )
1266
1267 response = self._execute(conn, try_read)
1268

Callers

nothing calls this directly

Calls 3

can_readMethod · 0.45
connectMethod · 0.45
read_responseMethod · 0.45

Tested by

no test coverage detected