Skip to content

Commit 5d4d936

Browse files
committed
don't auto-start the websocket
1 parent 04af142 commit 5d4d936

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

twitchio/ext/eventsub/websocket.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def __init__(self, client: Client, http: http.EventSubHTTP):
8787
self.client = client
8888
self._http = http
8989
self._subscription_pool = _WakeupList[_Subscription]()
90+
self._subscription_pool.add_append_callback(self._wakeup_and_connect)
9091
self._sock: Optional[aiohttp.ClientWebSocketResponse] = None
9192
self._pump_task: Optional[asyncio.Task] = None
9293
self._timeout: Optional[int] = None
@@ -119,8 +120,6 @@ async def _wakeup_and_connect(self, obj: _Subscription):
119120
await self._subscribe(obj)
120121
return
121122

122-
await self.connect()
123-
124123
async def connect(self, reconnect_url: Optional[str] = None):
125124
if not self._subscription_pool:
126125
return # TODO: should this raise?

0 commit comments

Comments
 (0)