dockyard_noblock.py 文件源码

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

项目:dockyard 作者: maidstone-hackspace 项目源码 文件源码
def threaded_task(function, *args, **kwargs):
    """Run function(*args, **kwargs) inside a thread and return the result."""
    def _task(task_return):
        def _thread():
            result = function(*args, **kwargs)
            gobject.idle_add(task_return, result)
        thread = threading.Thread(target=_thread, args=())
        thread.setDaemon(True)
        thread.start()
    return _task

# Example of usage
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号