今天发现 1 个 io 爆表的 websocket 封装库, 大家有兴趣的可以看下. - V2EX
2020-02-10 20:47:55 Author: www.v2ex.com(查看原文) 阅读量:394 收藏

uWebSockets.py

官方给的 benchmark

perf

代码

import uws
import asyncio

# Integrate with asyncio
asyncio.set_event_loop(uws.Loop())

app = uws.App({
        "some": "option"
})

def getHandler(res, req):
	res.end("Hello Python!")

app.get("/*", getHandler)

def listenHandler():
        print("Listening to port 3000")

app.listen(3000, listenHandler)

# Run asyncio event loop
asyncio.get_event_loop().run_forever()

文章来源: https://www.v2ex.com/t/643473#reply0
如有侵权请联系:admin#unsafe.sh