update handler
This commit is contained in:
parent
02142ffb2b
commit
249a85539d
14
app.py
14
app.py
@ -33,7 +33,7 @@ async def disconnect(project_id,ws):
|
||||
clients.get(project_id,[]).remove(ws)
|
||||
|
||||
|
||||
async def process(ws, path):
|
||||
async def handler(ws, path):
|
||||
project_id = ""
|
||||
user = ""
|
||||
async for msg in ws:
|
||||
@ -49,10 +49,10 @@ async def process(ws, path):
|
||||
pass
|
||||
await disconnect(project_id,ws)
|
||||
|
||||
async def main():
|
||||
async with websockets.serve(handler, "", 9080, compression=None):
|
||||
await asyncio.Future() # run forever
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
start_server = websockets.serve(process, 'localhost', 5000, compression=None)
|
||||
finally:
|
||||
pass
|
||||
asyncio.get_event_loop().run_until_complete(start_server)
|
||||
asyncio.get_event_loop().run_forever()
|
||||
asyncio.run(main())
|
@ -3,6 +3,7 @@
|
||||
BASE=$(dirname $0)
|
||||
cd $BASE
|
||||
git pull
|
||||
python3 -m venv env
|
||||
source env/bin/activate
|
||||
pip3 install -r requirements.txt
|
||||
python3 app.py
|
Loading…
x
Reference in New Issue
Block a user