proxystore.p2p.relay.manager¶
Helper classes for managing clients connected to a relay server.
Client
dataclass
¶
Client(
name: str,
uuid: UUID,
user: UserT,
websocket: ServerConnection,
created: datetime = _utc_current_time(),
)
Bases: Generic[UserT]
Representation of client connection owned by a user.
Attributes:
-
name
(str
) –Name of client.
-
uuid
(UUID
) –UUID of client.
-
user
(UserT
) –Auth user information.
-
websocket
(ServerConnection
) –WebSocket connection to the client.
-
created
(datetime
) –Time the client was created at.
ClientManager
¶
Bases: Generic[UserT]
Manages active connections with authenticated clients.
Warning
This class is intended for internal use by the
RelayServer
.
Source code in proxystore/p2p/relay/manager.py
get_clients
¶
get_client_by_uuid
¶
get_client_by_websocket
¶
get_client_by_websocket(
websocket: ServerConnection,
) -> Client[UserT] | None
Get a client by the current websocket connection.