toilpromise.py 文件源码

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

项目:hgvm-builder 作者: BD2KGenomics 项目源码 文件源码
def promise_executor_job(job, promise):
    """
    Toil job that runs a promise with an executor. Executes the executor and
    rejects/resolves the promise.

    Returns the promise's success result and error, as a pair.

    """

    executor = dill.loads(promise.executor_dill)

    # Run the executor, and handle resolution/rejection, possibly scheduling
    # child jobs
    executor(lambda result: promise.handle_resolve(job, result),
        lambda err: promise.handle_reject(job, err))

    # Grab the cached result and return it
    return (promise.result, promise.err)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号