stompman 2.0.0__tar.gz → 2.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {stompman-2.0.0 → stompman-2.0.1}/PKG-INFO +1 -1
- {stompman-2.0.0 → stompman-2.0.1}/stompman/client.py +1 -1
- {stompman-2.0.0 → stompman-2.0.1}/stompman/connection_manager.py +6 -3
- {stompman-2.0.0 → stompman-2.0.1}/.gitignore +0 -0
- {stompman-2.0.0 → stompman-2.0.1}/pyproject.toml +0 -0
- {stompman-2.0.0 → stompman-2.0.1}/stompman/__init__.py +0 -0
- {stompman-2.0.0 → stompman-2.0.1}/stompman/config.py +0 -0
- {stompman-2.0.0 → stompman-2.0.1}/stompman/connection.py +0 -0
- {stompman-2.0.0 → stompman-2.0.1}/stompman/connection_lifespan.py +0 -0
- {stompman-2.0.0 → stompman-2.0.1}/stompman/errors.py +0 -0
- {stompman-2.0.0 → stompman-2.0.1}/stompman/frames.py +0 -0
- {stompman-2.0.0 → stompman-2.0.1}/stompman/py.typed +0 -0
- {stompman-2.0.0 → stompman-2.0.1}/stompman/serde.py +0 -0
- {stompman-2.0.0 → stompman-2.0.1}/stompman/subscription.py +0 -0
- {stompman-2.0.0 → stompman-2.0.1}/stompman/transaction.py +0 -0
|
@@ -175,4 +175,4 @@ class Client:
|
|
|
175
175
|
def is_alive(self) -> bool:
|
|
176
176
|
return (
|
|
177
177
|
self._connection_manager._active_connection_state or False # noqa: SLF001
|
|
178
|
-
) and self._connection_manager._active_connection_state.is_alive() # noqa: SLF001
|
|
178
|
+
) and self._connection_manager._active_connection_state.is_alive(self.check_server_alive_interval_factor) # noqa: SLF001
|
|
@@ -28,10 +28,13 @@ class ActiveConnectionState:
|
|
|
28
28
|
lifespan: "AbstractConnectionLifespan"
|
|
29
29
|
server_heartbeat: Heartbeat
|
|
30
30
|
|
|
31
|
-
def is_alive(self) -> bool:
|
|
31
|
+
def is_alive(self, check_server_alive_interval_factor: int) -> bool:
|
|
32
32
|
if not (last_read_time := self.connection.last_read_time):
|
|
33
33
|
return True
|
|
34
|
-
|
|
34
|
+
|
|
35
|
+
return (self.server_heartbeat.will_send_interval_ms / 1000 * check_server_alive_interval_factor) > (
|
|
36
|
+
time.time() - last_read_time
|
|
37
|
+
)
|
|
35
38
|
|
|
36
39
|
|
|
37
40
|
@dataclass(kw_only=True, slots=True)
|
|
@@ -99,7 +102,7 @@ class ConnectionManager:
|
|
|
99
102
|
await asyncio.sleep(receive_heartbeat_interval_seconds * self.check_server_alive_interval_factor)
|
|
100
103
|
if not self._active_connection_state:
|
|
101
104
|
continue
|
|
102
|
-
if not self._active_connection_state.is_alive():
|
|
105
|
+
if not self._active_connection_state.is_alive(self.check_server_alive_interval_factor):
|
|
103
106
|
self._active_connection_state = None
|
|
104
107
|
|
|
105
108
|
async def _create_connection_to_one_server(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|