transact.py 文件源码

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

项目:fluiddb 作者: fluidinfo 项目源码 文件源码
def run(self, function, *args, **kwargs):
        """Run C{function} in a thread.

        C{function} is run in a thread within a transaction wrapper, which
        commits the transaction if C{function} succeeds.  If it raises an
        exception the transaction is aborted.

        @param function: The function to run.
        @param args: Positional arguments to pass to C{function}.
        @param kwargs: Keyword arguments to pass to C{function}.
        @return: A C{Deferred} that will fire after the function has been run.
        """
        return deferToThreadPool(reactor, self._threadPool, self._transact,
                                 function, *args, **kwargs)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号