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

Method on_disconnect

redis/_parsers/base.py:147–153  ·  view source on GitHub ↗

Called when the socket disconnects

(self)

Source from the content-addressed store, hash-verified

145 self.encoder = connection.encoder
146
147 def on_disconnect(self):
148 "Called when the socket disconnects"
149 self._sock = None
150 if self._buffer is not None:
151 self._buffer.close()
152 self._buffer = None
153 self.encoder = None
154
155 def can_read(self, timeout: float = 0) -> bool:
156 # TODO: Rename this API; it detects pending data or dirty/closed

Callers 3

__del__Method · 0.95
disconnectMethod · 0.45
disconnectMethod · 0.45

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected