From a7c4b77d038a04eaa2c8623dde400aee450748eb Mon Sep 17 00:00:00 2001 From: Srdjan S Date: Thu, 17 Jun 2021 17:11:16 +0200 Subject: [PATCH 1/2] Add async transport mode --- fastapi_socketio/socket_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastapi_socketio/socket_manager.py b/fastapi_socketio/socket_manager.py index 142da69..b12b54a 100644 --- a/fastapi_socketio/socket_manager.py +++ b/fastapi_socketio/socket_manager.py @@ -2,7 +2,6 @@ from typing import Optional, Union from fastapi import FastAPI - class SocketManager: """ Integrates SocketIO with FastAPI app. @@ -23,9 +22,10 @@ def __init__( mount_location: str = "/ws", socketio_path: str = "socket.io", cors_allowed_origins: Union[str, list] = '*', + async_mode: str = "asgi" ) -> None: # TODO: Change Cors policy based on fastapi cors Middleware - self._sio = socketio.AsyncServer(async_mode="asgi", cors_allowed_origins=cors_allowed_origins) + self._sio = socketio.AsyncServer(async_mode=async_mode, cors_allowed_origins=cors_allowed_origins) self._app = socketio.ASGIApp( socketio_server=self._sio, socketio_path=socketio_path ) From fa4280e167d10cdf916f7e930d68454b9deab94a Mon Sep 17 00:00:00 2001 From: Srdjan S Date: Thu, 17 Jun 2021 17:14:24 +0200 Subject: [PATCH 2/2] Bump package version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 18efdd3..bca6098 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup import os -VERSION = "0.0.7" +VERSION = "0.0.8" def get_long_description():