()
| 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 |
nothing calls this directly
no test coverage detected