- 博客(12)
- 收藏
- 关注
原创 Twisted Cron的用法
可以像使用linux下cron那样使用twisted的scheduling.http://code.google.com/p/twistedcronservice/ 不过我更喜欢用twisted自己的Scheduling utility http://twistedmatrix.com/trac/browser/trunk/twisted/internet/task.py加上C
2009-04-30 16:47:00 2733
原创 svn hook的post-commit不执行咋办?
在post-commit文件上加: export LANG=zh_CN.UTF-8 update: post-commit.tmpl只是post-commit.bat的一个模板, 执行的是post-commit.bat(win), 在linux下是post-commit. 如果你用win, 修改bat就可以了.
2009-04-30 14:58:00 9034 2
原创 Trivial About Apache+mod_wsgi+TG2
1. Apache2启动时找不到mod_wsgi:mod_wsgi没ln到正确的文件上ln -s /usr/lib/apache2/modules/mod_wsgi.so /usr/lib/apache2/modules/mod_wsgi.so-2.5 2. cPickle.so:: PyUnicodeUCS2_DecodeUTF8错误Python编译的参数,和Python m
2009-04-30 13:56:00 1224
原创 笔记:timeit使用
需要做benchmark,非web程序。用python自带的timeit模块。 代码: #! /usr/bin/python# -*- coding: utf-8 -*- import xmlrpclib, timeit t = timeit.Timer("s.interprete(三里庵的贵人香)", "import xmlrpclib/ns
2009-04-28 17:53:00 1378
原创 Twisted.web的性能测试
想了解一下twisted单独作为web服务器的性能。 所以用webpy写一个简单的页面,挂上twisted的wsgi跑一下。测试代码:import webfrom twisted.web2 import wsgi,server, channel, staticfrom twisted.application import service, strportsurls =
2009-04-26 13:36:00 3881 1
原创 笔记:安装Stackless
aptitude install libreadline-dev./configure --prefix=/opt/stackless --with-readline --with-zlib=/usr/includemakemake install
2009-04-24 21:48:00 1606
原创 Concurrence系列-远程调用
Concurrence的文档里没有提到这个系列的方法。我还是从unittest里找到的。 经过一番折腾,加上和作者的交流。现在大概能run的起来了。 远程调用,要使用concurrence.remote包下的RemoteServer, RemoteTasklet, RemoteClient三个对象。 过程是这样,服务端要用RemoteServer来启动一个服务,绑
2009-04-24 15:23:00 899
原创 Concurrence系列-HTTP
服务端 from concurrence import dispatchfrom concurrence.http import WSGIServerdef hello_world(environ, start_response): start_response("200 OK", []) return ["Hello, world!"]def main()
2009-04-23 16:16:00 627
原创 Concurrence系列-Message使用
Concurrence里最基本的执行单位是Tasklet,最基本的通信(单位)就是Message了。很清晰。 Message是这样定义的:class MSG_XXX(Message): pass 从命名规则上讲,习惯把Message声明为 MSG_开头的。 每个Tasklet都会有一个mailbox, 用来接收其他task发来的Message。 Taskle
2009-04-23 15:22:00 752
原创 Concurrence系列-Tasklet使用
Concurrence框架中,最小的执行单位就是tasklet了。 创建一个Tasklet from concurrence import dispatch, Taskletdef greeting(msg): print msgdef start(): Tasklet.new(greeting)("Hello") Taskl
2009-04-23 14:48:00 759
原创 Concurrence系列-安装
Concurrence的安装还是比较正常的(比那些编译时报出100个error的东西好多了)。 我试了两个平台,有奔头(8.x,企业版),和Mac(leopard), 有奔头下, 可能需要apt-get install python-devapt-get install libevent-dev easy_install pyrex
2009-04-23 14:39:00 821
原创 Concurrence-concurrent网络应用必备
在寻找一个异步框架的时候,找到这个框架,Concurrence(http://opensource.hyves.org/concurrence/index.html) Hello world:from concurrence import dispatchdef hello(): print "Hello World!" if __name__ ==
2009-04-23 14:24:00 829
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人