Skip to content

Commit 8c8f74c

Browse files
committed
Adding is_alive method to check connection status in Client class
1 parent 7ea5b6c commit 8c8f74c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/stompman/stompman/client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,8 @@ async def subscribe_with_manual_ack(
171171
)
172172
await subscription._subscribe() # noqa: SLF001
173173
return subscription
174+
175+
def is_alive(self) -> bool:
176+
return (
177+
self._connection_manager._active_connection_state or False # noqa: SLF001
178+
) and self._connection_manager._active_connection_state.is_alive() # noqa: SLF001

0 commit comments

Comments
 (0)