File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
services/web/server/src/simcore_service_webserver/socketio Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 22from collections .abc import Awaitable , Callable
33from functools import wraps
44from types import ModuleType
5- from typing import Any
5+ from typing import Any , Final
66
77from aiohttp import web
88from socketio import AsyncServer # type: ignore[import-untyped]
99
10- APP_CLIENT_SOCKET_DECORATED_HANDLERS_KEY = f"{ __name__ } .socketio_handlers"
11- APP_CLIENT_SOCKET_SERVER_KEY = f"{ __name__ } .socketio_socketio"
10+ APP_CLIENT_SOCKET_DECORATED_HANDLERS_APPKEY : Final = web .AppKey (
11+ "APP_CLIENT_SOCKET_DECORATED_HANDLERS" , list [Callable ]
12+ )
13+ APP_CLIENT_SOCKET_SERVER_APPKEY : Final = web .AppKey (
14+ "APP_CLIENT_SOCKET_SERVER" , AsyncServer
15+ )
1216
1317
1418def get_socket_server (app : web .Application ) -> AsyncServer :
15- return app [APP_CLIENT_SOCKET_SERVER_KEY ]
19+ return app [APP_CLIENT_SOCKET_SERVER_APPKEY ]
1620
1721
1822# The socket ID that was assigned to the client
@@ -76,7 +80,7 @@ def register_socketio_handlers(app: web.Application, module: ModuleType):
7680 partial_fcts = [
7781 _socket_io_handler (app )(func_handler ) for func_handler in member_fcts
7882 ]
79- app [APP_CLIENT_SOCKET_DECORATED_HANDLERS_KEY ] = partial_fcts
83+ app [APP_CLIENT_SOCKET_DECORATED_HANDLERS_APPKEY ] = partial_fcts
8084
8185 # register the fcts
8286 for func in partial_fcts :
You can’t perform that action at this time.
0 commit comments