mirror of
https://github.com/rommapp/romm.git
synced 2026-02-18 23:42:07 +01:00
19 lines
560 B
Python
19 lines
560 B
Python
import socketio # type: ignore
|
|
from config import ENABLE_EXPERIMENTAL_REDIS
|
|
from handler.redis_handler import redis_url
|
|
|
|
|
|
class SocketHandler:
|
|
def __init__(self) -> None:
|
|
self.socket_server = socketio.AsyncServer(
|
|
cors_allowed_origins="*",
|
|
async_mode="asgi",
|
|
logger=False,
|
|
engineio_logger=False,
|
|
client_manager=socketio.AsyncRedisManager(redis_url)
|
|
if ENABLE_EXPERIMENTAL_REDIS
|
|
else None,
|
|
)
|
|
|
|
self.socket_app = socketio.ASGIApp(self.socket_server)
|