def _start_consuming(self):
"""
Start consuming messages.
This function is blocking.
"""
consumer = kombu.Consumer(
self._conn,
queues=[self._callback_queue],
on_message=self._on_message,
# accept=[self._codec.content_type],
no_ack=True
)
consumer.consume()
while self._is_running:
try:
self._conn.drain_events(timeout=0.5)
except socket.timeout:
continue
评论列表
文章目录