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)
|
clients.get(project_id,[]).remove(ws)
|
||||||
|
|
||||||
|
|
||||||
async def process(ws, path):
|
async def handler(ws, path):
|
||||||
project_id = ""
|
project_id = ""
|
||||||
user = ""
|
user = ""
|
||||||
async for msg in ws:
|
async for msg in ws:
|
||||||
@ -49,10 +49,10 @@ async def process(ws, path):
|
|||||||
pass
|
pass
|
||||||
await disconnect(project_id,ws)
|
await disconnect(project_id,ws)
|
||||||
|
|
||||||
|
async def main():
|
||||||
|
async with websockets.serve(handler, "", 9080, compression=None):
|
||||||
|
await asyncio.Future() # run forever
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
try:
|
asyncio.run(main())
|
||||||
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()
|
|
@ -3,6 +3,7 @@
|
|||||||
BASE=$(dirname $0)
|
BASE=$(dirname $0)
|
||||||
cd $BASE
|
cd $BASE
|
||||||
git pull
|
git pull
|
||||||
|
python3 -m venv env
|
||||||
source env/bin/activate
|
source env/bin/activate
|
||||||
pip3 install -r requirements.txt
|
pip3 install -r requirements.txt
|
||||||
python3 app.py
|
python3 app.py
|
Loading…
x
Reference in New Issue
Block a user