Skip to content

Commit

Permalink
pingpong
Browse files Browse the repository at this point in the history
  • Loading branch information
jakekaplan committed Sep 6, 2024
1 parent 32fe7ac commit 0736e44
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/prefect/events/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,14 @@ async def __aexit__(
return await super().__aexit__(exc_type, exc_val, exc_tb)

def raise_for_connection_error(self):
with self._sync_connect():
pass
with self._sync_connect() as ws:
pong = ws.ping()
pong.wait()

async def araise_for_connection_error(self):
async with self._deferred_connect():
pass
async with self._deferred_connect() as ws:
pong = ws.ping()
await pong

async def _reconnect(self) -> None:
assert self._connect
Expand Down

0 comments on commit 0736e44

Please sign in to comment.