client.py 文件源码

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

项目:caproto 作者: NSLS-II 项目源码 文件源码
def register_user_callback(self, func):
        """
        Func to be called when a subscription receives a new EventAdd command.

        This function will be called by a Task in the main thread. If ``func``
        needs to do CPU-intensive or I/O-related work, it should execute that
        work in a separate thread of process.
        """
        if inspect.ismethod(func):
            self._callback = weakref.WeakMethod(func, self._callback_cleared)
        else:
            self._callback = weakref.ref(func, self._callback_cleared)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号