async.py 文件源码

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

项目:sound-machine 作者: rhelmot 项目源码 文件源码
def queue(self, when, func, relative=True):
        """
        Queue an event some number of frames in the future.

        :param when:        The number of frames in the future to perform the event
        :param func:        The thing to do in the future
        :param relative:    Optional. If set to false, `when` serves as an absolute timestamp since
                            play started instead of a relative count.

        If func is a callable object, it will be called.
        If func is a tuple, `self.play()` will be called with the tuple contents as args
        Other wise, `self.play()` will be called with func as an argument.
        """
        if relative: when += self.frame
        bisect.insort(self.callbacks, (-when, func))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号