import logging
import threading
import time
-from typing import Optional
-from pika.adapters import AsyncioConnection
from pika.channel import Channel
from distbot.common.action import Action, send_action
def __init__(self, bot, queue_name):
self._bot = bot
- self._connection: Optional[AsyncioConnection] = None
- self._channel: Optional[Channel] = None
+ self._connection = None
+ self._channel = None
self._queue_name = queue_name
self._consumer_tag = None
self._consumer_tag = self._channel.basic_consume(
self.on_message, self._queue_name
)
- logging.info(
- f"Setup consumer for actions on ch {self._channel} on con {self._connection} with tag {self._consumer_tag}")
+ logging.info("Setup consumer for actions on ch %s on con %s with tag %s", self._channel, self._connection, self._consumer_tag)
def on_message(self, ch, method, properties, body):
logging.info('Received message # %s from %s: %s',