好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

eventlet time sleep

eventlet time sleep

Monkeypatching the Standard Library ?

The other way of greening an application is simply to monkeypatch the standard library. This has the disadvantage of appearing quite magical, but the advantage of avoiding the late-binding problem.

eventlet.patcher. monkey_patch ( os=None , select=None , socket=None , thread=None , time=None , psycopg=None ) ?

This function monkeypatches the key system modules by replacing their key elements with green equivalents. If no arguments are specified, everything is patched:

 import   eventlet 
 eventlet  .  monkey_patch  () 

The keyword arguments afford some control over which modules are patched, in case that’s important. Most patch the single module of the same name (e.g. time=True means that the time module is patched [time.sleep is patched by eventlet.sleep]). The exceptions to this rule are socket , which also patches the ssl module if present; and thread , which patches thread , threading , and Queue .

Here’s an example of using monkey_patch to patch only a few modules:

 import   eventlet 
 eventlet  .  monkey_patch  (  socket  =  True  ,   select  =  True  ) 

查看更多关于eventlet time sleep的详细内容...

  阅读:32次

上一篇: querypath.org

下一篇:文胜语录

CopyRight:2016-2025好得很程序员自学网 备案ICP:湘ICP备09009000号-16 http://haodehen.cn
本站资讯不构成任何建议,仅限于个人分享,参考须谨慎!
本网站对有关资料所引致的错误、不确或遗漏,概不负任何法律责任。
本网站刊载的所有内容(包括但不仅限文字、图片、LOGO、音频、视频、软件、程序等)版权归原作者所有。任何单位或个人认为本网站中的内容可能涉嫌侵犯其知识产权或存在不实内容时,请及时通知本站,予以删除。

网站内容来源于网络分享,如有侵权发邮箱到:kenbest@126.com,收到邮件我们会即时下线处理。
网站框架支持:HDHCMS   51LA统计 百度统计
Copyright © 2018-2025 「好得很程序员自学网
[ SiteMap ]