core.py 文件源码

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

项目:asgi_rabbitmq 作者: proofit404 项目源码 文件源码
def schedule(self, f, *args, **kwargs):
        """
        Try to acquire connection access lock.  Then call protocol method.
        Return concurrent Future instance you can wait in the other
        thread.
        """

        self.wait_open()
        # RabbitMQ operations are multiplexed between different AMQP
        # method callbacks.  Final result of the protocol method call
        # will be set inside one of this callbacks.  So other thread
        # will be able to wait unless this event happens in the
        # connection event loop.
        future = Future()
        with self.lock:
            self.process(get_ident(), (f, args, kwargs), future)
        return future
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号