uvicorn
- Fastapi的Uvicorn 是基于 uvloop 和 httptools 构建的非常快速的 ASGI 异步服务器,支持ASGI协议(WSGI的升级版,增加了对websocket的支持,加入了异步)
- uvicorn是一个基于asyncio开发的一个轻量级高效的web服务器框架。
- 它目前支持http,websockets,Pub/Sub 广播,并且可以扩展到其他协议和消息类型。
- uvicorn 仅支持python 3.5.3以上版本
- 目前uvloop仅能安装于ux平台上,不支持Windows平台安装(目前还是使用asyncio库)
远程连接linux开发项目
以pycharm为例:
1、先在Tools中点击Deployment中的Configuration
![image-20210225170310335](https://gitee.com/cuicheng688/img/raw/master/img/20210225170317.png)
2、在弹窗中点击“+”号,选择SFTP,
![image-20210225170548410](https://gitee.com/cuicheng688/img/raw/master/img/20210225170548.png)
3、随便填一个服务名称
![image-20210225170816332](https://gitee.com/cuicheng688/img/raw/master/img/20210225170816.png)
4、填写服务器/虚拟机的地址、用户名、密码等
![image-20210225085645082](https://gitee.com/cuicheng688/img/raw/master/img/20210225170919.png)
5、填写ux环境的项目路径
![image-20210225085739419](https://gitee.com/cuicheng688/img/raw/master/img/20210225171120.png)
6、pycharm中连接ux环境
7、在pycharm中配置项目依赖的解释器(选择ux环境中的python3解释器)
![image-20210225085941996](https://gitee.com/cuicheng688/img/raw/master/img/20210225171434.png)
补充:
-同一个浏览器向同一个地址发请求,必须等待第一个完成以后,才发出第二个请求
-异步框架并发高体现在可以使用一个线程处理多个请求,(如果是同步框架需要用多个线程处理)