文章分类 -  twisted

twisted 线程里的几个函数
摘要:twisted里是通过回调机制来实现类似于多线程,意思是防止程序的运行由于等待某项任务的完成而陷入阻塞停滞,提高整体运行的效率。from twisted.internet import reactor1. reactor.callFromThreadMethod callFromThread:Cause a function to be executed by the reactor thread. Use this method when you want to run a function in the reactor's thread from another thread. 阅读全文
posted @ 2011-02-12 10:24 twelfthing 阅读(1698) 评论(0) 推荐(0)
twisted webserver
摘要:1. SOAP[代码]测试代码[代码]2. XMLRPC[代码]测试[代码]3.JSONRPC,twisted似乎还不支持,但是有很多开源的项目把这个做了。 阅读全文
posted @ 2011-01-27 11:12 twelfthing 阅读(456) 评论(0) 推荐(0)
twisted的web2模块
摘要:前段时间一直在用twisted在做server,当时在技术的选择上有些盲目,导致做到现在走了不少的弯路。还是写点东西总结一下吧。twisted+fastcgisearch_server.py代码在以fastcgi的方式配置到nginx上去,具体的配置网上到处都是。启动nginx,命令行里运行 twistd.py -noy search_server.py就行了。这样简单的twisted+fastc... 阅读全文
posted @ 2010-12-03 20:34 twelfthing 阅读(683) 评论(0) 推荐(0)