码迷,mamicode.com
首页 >  
搜索关键字:asyncio    ( 230个结果
非常适合小白的 Asyncio 教程
非常适合小白的 Asyncio 教程 原文:https://segmentfault.com/a/1190000008814676 所谓「异步 IO」,就是你发起一个 IO 操作,却不用等它结束,你可以继续做其他事情,当它结束时,你会得到通知。 Asyncio 是并发(concurrency)的一种 ...
分类:其他好文   时间:2020-03-24 19:17:01    阅读次数:78
Concurrency with asyncio
Concurrency is about dealing with lots of things at once. Parallelism is about doing lots of things at once. Not the same, but related. One is about s ...
分类:其他好文   时间:2020-03-21 09:32:11    阅读次数:59
python asyncio 获取协程返回值和使用callback
Reference from: https://www.cnblogs.com/callyblog/p/11216961.html 1. 获取协程返回值,实质就是future中的task import asyncioimport timeasync def get_html(url): print( ...
分类:编程语言   时间:2020-03-08 19:40:33    阅读次数:331
python的deque(双向)队列详解
首先 python的队列有很多种 Python标准库中包含了四种队列,分别是queue.Queue / asyncio.Queue / multiprocessing.Queue / collections.deque 可见deque是标准库collections中的 这其中最好用的是deque 以 ...
分类:编程语言   时间:2020-03-07 22:38:41    阅读次数:147
Python基础-协程(一)
协程 究竟什么是协程? 究竟协程有什么用? 1.涉及到同步锁。 2.涉及到线程阻塞状态和可运行状态之间的切换。 3.涉及到线程上下文的切换。 以上涉及到的任何一点,都是非常耗费性能的操作。 next()函数用来创建一个协程嗷 yield会暂停,当send()的时候才会继续 python中使用asyn ...
分类:编程语言   时间:2020-03-06 23:42:08    阅读次数:82
Django3 中遇到django.core.exceptions.ImproperlyConfigured mysqlclient 1.3.13 or newer is required; you have 0.9.3.异常的解决方案
转自:https://yuntianti.com/posts/fix-django3-mysqlclient-import-error/ Django 近期发布了3.0版本,其中首度支持了asyncio让人兴奋, 为此引入了新的网关接口协议ASGI。按异步IO的实现原理,即使使用ASGI替代WSGI ...
分类:数据库   时间:2020-02-22 00:40:22    阅读次数:125
asyncio 并发编程(二)
Future 对象 表示还没有完成的工作结果。事件循环可以通过监视一个 对象的状态来指示它已经完成。 对象有几个状态: :循环 :运行 :完成 :取消 获取 Future 中的结果 创建 的时候, 为`pending running done task cancel`。 运行结果: 总结: awai ...
分类:其他好文   时间:2020-02-19 19:06:52    阅读次数:74
[未解决问题记录]python asyncio+aiohttp出现Exception ignored:RuntimeError('Event loop is closed')
找了半天没找到原因,记录一下 操作系统:windows 8.1 python版本:python 3.8.1 aiohttp版本:3.6.2 源码: 1 import asyncio 2 import aiohttp 3 4 5 async def aiohttp_request_test(url): ...
分类:编程语言   时间:2020-02-15 10:15:13    阅读次数:208
gunicorn 多种工作模式
gunicorn 多种工作模式 gunicorn 支持如下4种工作模式 Sync Workers Async Workers Tornado Workers AsyncIO workers 工作模式是通过work_class参数配置的值:缺省值: sync sync gevent eventlet ...
分类:其他好文   时间:2020-02-10 13:47:29    阅读次数:183
初始Python的异步IO操作(待完善)
1 import aiohttp 2 import asyncio 3 4 def consumer(): 5 r='' 6 while True: 7 n = yield r 8 if n: 9 r='200 OK' 10 print('客户取走了%s'%(str(n))) 11 else: 12 ...
分类:编程语言   时间:2020-02-10 00:14:11    阅读次数:95
230条   上一页 1 ... 3 4 5 6 7 ... 23 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!