monkey.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:RealtimePythonChat 作者: quangtqag 项目源码 文件源码
def patch_os():
    """
    Replace :func:`os.fork` with :func:`gevent.fork`, and, on POSIX,
    :func:`os.waitpid` with :func:`gevent.os.waitpid` (if the
    environment variable ``GEVENT_NOWAITPID`` is not defined). Does
    nothing if fork is not available.

    .. caution:: This method must be used with :func:`patch_signal` to have proper SIGCHLD
         handling and thus correct results from ``waitpid``.
         :func:`patch_all` calls both by default.

    .. caution:: For SIGCHLD handling to work correctly, the event loop must run.
         The easiest way to help ensure this is to use :func:`patch_all`.
    """
    patch_module('os')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号