Skip to content

Commit

Permalink
fix: update broken method calls (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickvanzweeden authored Sep 25, 2024
1 parent 2ce6efb commit b162e00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions realtime/_async/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def on_close(*args):
logging.info(f"channel {self.topic} closed")
self.rejoin_timer.reset()
self.state = ChannelStates.CLOSED
self.socket._remove(self)
self.socket.remove_channel(self)

def on_error(payload, *args):
if self.is_leaving or self.is_closed:
Expand Down Expand Up @@ -290,11 +290,11 @@ async def join(self) -> AsyncRealtimeChannel:
:return: Channel
"""
try:
await self.socket._send(
await self.socket.send(
{
"topic": self.topic,
"event": "phx_join",
"payload": {"config": self.channel_params},
"payload": {"config": self.params},
"ref": None,
}
)
Expand Down
4 changes: 2 additions & 2 deletions realtime/_async/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ async def _listen(self) -> None:
except websockets.exceptions.ConnectionClosed:
if self.auto_reconnect:
logger.info("Connection with server closed, trying to reconnect...")
await self._connect()
await self.connect()
for topic, channel in self.channels.items():
await channel.join()
else:
Expand Down Expand Up @@ -190,7 +190,7 @@ async def _heartbeat(self) -> None:
except websockets.exceptions.ConnectionClosed:
if self.auto_reconnect:
logger.info("Connection with server closed, trying to reconnect...")
await self._connect()
await self.connect()
else:
logger.exception("Connection with the server closed.")
break
Expand Down

0 comments on commit b162e00

Please sign in to comment.