client.py 文件源码

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

项目:microservices 作者: viatoriche 项目源码 文件源码
def __init__(self, connection='amqp:///', name=None, logger=None, limit=None):
        """Initialization of Client instance

        :param connection: connection for broker
        :type connection: str, None, kombu.connections.Connection, dict
        """

        self.connection = self._get_connection(connection)
        self.exchanges = {}

        if name is None:
            try:
                name = '<client: {}>'.format(self.connection.as_uri())
            except:  # pragma: no cover
                # Errors with filesystem transport
                name = '<client: {}>'.format(self.connection.transport_cls)

        if logger is None:
            logger = get_logger(__name__)

        self.logger = InstanceLogger(self, logger)

        self.name = name
        self.logger.debug('%s built', self.name)

        if limit is None:
            # Set limit as global kombu limit.
            limit = pools.get_limit()
        self.limit = limit
        self.connections = pools.Connections(self.limit)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号