Skip to content

Commit 27e195c

Browse files
committed
make connect callback methods internal
1 parent e5f5167 commit 27e195c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

redis/asyncio/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ async def aclose(self):
792792
async with self._lock:
793793
if self.connection:
794794
await self.connection.disconnect()
795-
self.connection.deregister_connect_callback(self.on_connect)
795+
self.connection._deregister_connect_callback(self.on_connect)
796796
await self.connection_pool.release(self.connection)
797797
self.connection = None
798798
self.channels = {}
@@ -855,7 +855,7 @@ async def connect(self):
855855
)
856856
# register a callback that re-subscribes to any channels we
857857
# were listening to when we were disconnected
858-
self.connection.register_connect_callback(self.on_connect)
858+
self.connection._register_connect_callback(self.on_connect)
859859
else:
860860
await self.connection.connect()
861861
if self.push_handler_func is not None and not HIREDIS_AVAILABLE:

redis/asyncio/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,12 @@ def repr_pieces(self):
216216
def is_connected(self):
217217
return self._reader is not None and self._writer is not None
218218

219-
def register_connect_callback(self, callback):
219+
def _register_connect_callback(self, callback):
220220
wm = weakref.WeakMethod(callback)
221221
if wm not in self._connect_callbacks:
222222
self._connect_callbacks.append(wm)
223223

224-
def deregister_connect_callback(self, callback):
224+
def _deregister_connect_callback(self, callback):
225225
try:
226226
self._connect_callbacks.remove(weakref.WeakMethod(callback))
227227
except ValueError:

0 commit comments

Comments
 (0)