最小异步http服务器
async-http-minimal的Python项目详细描述
#极简异步http服务器
此框架的灵感来自[sanic]框架(https://github.com/huge-success/sanic)。
此框架设计快速,能够在最多1.5秒内启动(请参阅[cold start(https://medium.com/@denismakogogong/investigiging-pythons-performance-performance-issue-cold-start-8ebf4443a8a20)问题。
<如何安装
`` bash ``bash
pip安装异步http minimal
```` ` `
` ` ` ` ` ` ` `
import-asynciio
从异步http导入来自异步http导入响应的路由器
async def hello(请求):
return response.text(“hello world!”)
>loop=asyncio.get_event_loop()
sock=socket.socket(socket.af-inet,socket.sock-stream)sock.sock.bind((“localhost”,99999))
开始服务,运行永远=srv.run(sock=sock,loop=loop)
start服务()
```
此框架的灵感来自[sanic]框架(https://github.com/huge-success/sanic)。
此框架设计快速,能够在最多1.5秒内启动(请参阅[cold start(https://medium.com/@denismakogogong/investigiging-pythons-performance-performance-issue-cold-start-8ebf4443a8a20)问题。
<如何安装
`` bash ``bash
pip安装异步http minimal
```` ` `
` ` ` ` ` ` ` `
import-asynciio
从异步http导入来自异步http导入响应的路由器
async def hello(请求):
return response.text(“hello world!”)
>loop=asyncio.get_event_loop()
sock=socket.socket(socket.af-inet,socket.sock-stream)sock.sock.bind((“localhost”,99999))
start服务()
```