Fork me on GitHub
摘要: (1)websocket 协议 与 http协议 websocket 协议,双工通道 socket连接不断开 http 协议 ,只能请求响应 (用户主动获取) socket连接断开 都是基于socket 客户端都是浏览器 (2)轮询 一般用户量少的 都是用 websocket来做即时通讯 轮询 一直 阅读全文
posted @ 2018-03-27 23:46 派对动物 阅读(426) 评论(0) 推荐(0)
摘要: 1 装饰器 + Future 从而实现Tornado的异步非阻塞 class AsyncHandler(tornado.web.RequestHandler): @gen.coroutine def get(self): future = Future() future.add_done_callb 阅读全文
posted @ 2018-03-27 23:40 派对动物 阅读(297) 评论(0) 推荐(0)
Top