utils.py 文件源码

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

项目:duct 作者: ducted 项目源码 文件源码
def fork(executable, args=(), env={}, path=None, timeout=3600):
    """fork
    Provides a deferred wrapper function with a timeout function

    :param executable: Executable
    :type executable: str.
    :param args: Tupple of arguments
    :type args: tupple.
    :param env: Environment dictionary
    :type env: dict.
    :param timeout: Kill the child process if timeout is exceeded
    :type timeout: int.
    """
    de = defer.Deferred()
    proc = ProcessProtocol(de, timeout)
    reactor.spawnProcess(proc, executable, (executable,)+tuple(args), env,
                         path)
    return de
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号