def __init__(self, driver, conn): super(AMQPListener, self).__init__(driver) self.conn = conn self.msg_id_cache = rpc_amqp._MsgIdCache() self.incoming = [] self._stopped = threading.Event() self._obsolete_reply_queues = ObsoleteReplyQueuesCache()
def __init__(self, driver, conn): super(AMQPListener, self).__init__(driver.prefetch_size) self.driver = driver self.conn = conn self.msg_id_cache = rpc_amqp._MsgIdCache() self.incoming = [] self._stopped = threading.Event() self._obsolete_reply_queues = ObsoleteReplyQueuesCache() self._pending_tasks = moves.queue.Queue() self._current_timeout = ACK_REQUEUE_EVERY_SECONDS_MIN
def __init__(self, reply_q, conn, allowed_remote_exmods): self.conn = conn self.allowed_remote_exmods = allowed_remote_exmods self.msg_id_cache = rpc_amqp._MsgIdCache() self.waiters = ReplyWaiters() self.conn.declare_direct_consumer(reply_q, self) self._thread_exit_event = threading.Event() self._thread = threading.Thread(target=self.poll) self._thread.daemon = True self._thread.start()
def __init__(self, driver, conn): super(AMQPListener, self).__init__(driver.prefetch_size) self.driver = driver self.conn = conn self.msg_id_cache = rpc_amqp._MsgIdCache() self.incoming = [] self._shutdown = threading.Event() self._shutoff = threading.Event() self._obsolete_reply_queues = ObsoleteReplyQueuesCache() self._message_operations_handler = MessageOperationsHandler( "AMQPListener") self._current_timeout = ACK_REQUEUE_EVERY_SECONDS_MIN
def __init__(self, reply_q, conn, allowed_remote_exmods): self.conn = conn #listen conn self.allowed_remote_exmods = allowed_remote_exmods self.msg_id_cache = rpc_amqp._MsgIdCache() #记录msg的_unique_id self.waiters = ReplyWaiters() #多个msg self.conn.declare_direct_consumer( reply_q, self) #在队列reply_q监听消费 init ?,回调self 1、类似声明 self._thread_exit_event = threading.Event() self._thread = threading.Thread(target=self.poll) self._thread.daemon = True self._thread.start()
def __init__(self, driver, conn): super(AMQPListener, self).__init__(driver.prefetch_size) #prefetch_size一次相取多少数据 self.driver = driver self.conn = conn self.msg_id_cache = rpc_amqp._MsgIdCache( ) #根据_unique_id检查重复,返回不重复的,------add() self.incoming = [] self._shutdown = threading.Event() #协程等待的信号,event.wait() self._shutoff = threading.Event() self._obsolete_reply_queues = ObsoleteReplyQueuesCache( ) #保存暂时不可达到的reply队列 self._message_operations_handler = MessageOperationsHandler( "AMQPListener") self._current_timeout = ACK_REQUEUE_EVERY_SECONDS_MIN