def __init__(self, db): self.db = db self.checker = Checker() connection = pika.BlockingConnection(pika.ConnectionParameters( host=QUEUE['HOST'], credentials=pika.credentials.PlainCredentials(QUEUE['USERNAME'], QUEUE['PASSWORD']) )) self.channel = connection.channel() self.channel.queue_declare(queue='tasks') print(' [*] Waiting for messages. To exit press CTRL+C')
def __init__(self, db): self.db = db # соединение с базой данных self.settings = ConfigGet( self.db).get_all_settings() # загрузка файла с настройками сервера self.checker = Checker() # подргружаем чекер (QUEUE or ASYNC) connection = pika.BlockingConnection( pika.ConnectionParameters( host=QUEUE['HOST'], credentials=pika.credentials.PlainCredentials( QUEUE['USERNAME'], QUEUE['PASSWORD']))) self.channel = connection.channel() self.channel.queue_declare(queue=QUEUE['QNAME']) print(' [*] Waiting for messages. To exit press CTRL+C')