mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-16 19:32:07 +00:00
33 lines
573 B
C++
33 lines
573 B
C++
|
#include <common/logger_useful.h>
|
||
|
#include <Storages/RabbitMQ/RabbitMQHandler.h>
|
||
|
|
||
|
namespace DB
|
||
|
{
|
||
|
|
||
|
RabbitMQHandler::RabbitMQHandler(event_base * evbase_, Poco::Logger * log_) :
|
||
|
LibEventHandler(evbase_),
|
||
|
evbase(evbase_),
|
||
|
log(log_)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
|
||
|
void RabbitMQHandler::onError(AMQP::TcpConnection * /*connection*/, const char * message)
|
||
|
{
|
||
|
LOG_ERROR(log, "Library error report: " << message);
|
||
|
stop();
|
||
|
}
|
||
|
|
||
|
|
||
|
void RabbitMQHandler::startNonBlock()
|
||
|
{
|
||
|
event_base_loop(evbase, EVLOOP_NONBLOCK);
|
||
|
}
|
||
|
|
||
|
void RabbitMQHandler::stop()
|
||
|
{
|
||
|
event_base_loopbreak(evbase);
|
||
|
}
|
||
|
|
||
|
}
|