Remove fastapi-socketio dependency, doesn't really do much for us and… (#4552)

* Remove fastapi-socketio dependency, doesn't really do much for us and isn't well maintained

* Run python black

* Remove fastapi_socketio import

* Add __app as class variable in case we ever need it later

* Run isort

---------

Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com>
This commit is contained in:
Brandon
2023-09-20 18:30:01 -04:00
committed by GitHub
parent 6ec347bd41
commit b915d74127
2 changed files with 6 additions and 4 deletions

View File

@ -3,16 +3,19 @@
from fastapi import FastAPI from fastapi import FastAPI
from fastapi_events.handlers.local import local_handler from fastapi_events.handlers.local import local_handler
from fastapi_events.typing import Event from fastapi_events.typing import Event
from fastapi_socketio import SocketManager from socketio import ASGIApp, AsyncServer
from ..services.events import EventServiceBase from ..services.events import EventServiceBase
class SocketIO: class SocketIO:
__sio: SocketManager __sio: AsyncServer
__app: ASGIApp
def __init__(self, app: FastAPI): def __init__(self, app: FastAPI):
self.__sio = SocketManager(app=app) self.__sio = AsyncServer(async_mode="asgi", cors_allowed_origins="*")
self.__app = ASGIApp(socketio_server=self.__sio, socketio_path="socket.io")
app.mount("/ws", self.__app)
self.__sio.on("subscribe_queue", handler=self._handle_sub_queue) self.__sio.on("subscribe_queue", handler=self._handle_sub_queue)
self.__sio.on("unsubscribe_queue", handler=self._handle_unsub_queue) self.__sio.on("unsubscribe_queue", handler=self._handle_unsub_queue)

View File

@ -48,7 +48,6 @@ dependencies = [
"facexlib", "facexlib",
"fastapi==0.88.0", "fastapi==0.88.0",
"fastapi-events==0.8.0", "fastapi-events==0.8.0",
"fastapi-socketio==0.0.10",
"huggingface-hub~=0.16.4", "huggingface-hub~=0.16.4",
"invisible-watermark~=0.2.0", # needed to install SDXL base and refiner using their repo_ids "invisible-watermark~=0.2.0", # needed to install SDXL base and refiner using their repo_ids
"matplotlib", # needed for plotting of Penner easing functions "matplotlib", # needed for plotting of Penner easing functions