在安装gevent时报错C:\leakScan-master\scanner>easy_installgevent
Searchingforgevent
Readinghttp://pypi.python.org/simple/gevent/
Bestmatch:gevent1.0.1
Downloadinghttps://pypi.python.org/packages/source/g/gevent/gevent-1.0.1.tar.gz
#md5=7b952591d1a0174d6eb..
分类:
编程语言 时间:
2014-11-30 17:18:28
阅读次数:
219
今天在用爬虫时gevent报了AssertionError: Impossible to call blocking function in the event loop callback异常,很奇怪,难道是patch_socket惹的货,因为之前没有使用patch_socket是正常的,代码简化如下import urllib
import gevent
from gevent.monkey im...
分类:
其他好文 时间:
2014-11-12 16:40:58
阅读次数:
340
libevTable of Contents1 libev1.1 About The Code1.2 EventLoop1.3 Watcher1.4 How it works1.4.1 ev_run1.4.2 fd_reify1.4.3 backend_poll1.4.4 timers_reify1...
分类:
其他好文 时间:
2014-11-07 20:42:49
阅读次数:
341
monkey patch指的是在运行时动态替换,一般是在startup的时候.
用过gevent就会知道,会在最开头的地方gevent.monkey.patch_all();把标准库中的thread/socket等给替换掉.这样我们在后面使用socket的时候可以跟平常一样使用,无需修改任何代码,但是它变成非阻塞的了.
之前做的一个游戏服务器,很多地方用的import json,后来发现ujs...
分类:
其他好文 时间:
2014-10-20 11:44:41
阅读次数:
224
1.安装flaskpip install flask2.安装geventpip install gevent3.安装gunicornpip install gunicorn版本信息例如以下:[root@rs-2 ~]# pip listFlask (0.10.1)gevent (1.0.1)gree...
分类:
其他好文 时间:
2014-10-12 11:02:38
阅读次数:
279
直接使用 pip 安装,连 example project 都运行不了。。。
要正常使用,关键是要使用正确版本的依赖包
Django (1.5.5)
django-socketio (0.3.2)
gevent (0.13.6)
gevent-socketio (0.2.1)
geve...
分类:
其他好文 时间:
2014-10-09 14:03:03
阅读次数:
251
一、安装编译所需的库。sudo apt-get install build-essential cmake pkg-config libcurl4-openssl-dev libsqlite3-dev libmozjs185-dev libev-dev libglib2.0-dev libpurpl...
分类:
其他好文 时间:
2014-10-02 00:28:01
阅读次数:
226
之前看到geventhttpclient这个项目,https://github.com/gwik/geventhttpclient,官方文档说非常快,因为响应使用了C的解析,所以我一直想把这玩意用到项目中,这两天一直在纠结这玩意,说实在一句话,比較难用,封装的不给力,最大缺陷例如以下:1.不支持重定...
分类:
编程语言 时间:
2014-09-27 21:25:30
阅读次数:
273