mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-01 21:45:10 +00:00
feat(remote): end a remote session when its client is gone
This commit is contained in:
@@ -8,6 +8,8 @@ import threading
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
from aiohttp import WSMessage
|
||||
from aiohttp.http_websocket import WS_CLOSED_MESSAGE
|
||||
|
||||
from tests.remote.unit.test_tunnel import wait_until
|
||||
from unshackle.core.api.input_bridge import InputBridge
|
||||
@@ -31,12 +33,9 @@ class FakeSocket:
|
||||
self.closed.set()
|
||||
return True
|
||||
|
||||
def __aiter__(self) -> FakeSocket:
|
||||
return self
|
||||
|
||||
async def __anext__(self) -> Any:
|
||||
async def receive(self) -> WSMessage:
|
||||
await self.closed.wait()
|
||||
raise StopAsyncIteration
|
||||
return WS_CLOSED_MESSAGE
|
||||
|
||||
|
||||
def entry_with_logs(count: int) -> SessionEntry:
|
||||
|
||||
Reference in New Issue
Block a user