ClickHouse/src/Storages/RabbitMQ/RabbitMQHandler.h

33 lines
585 B
C++
Raw Normal View History

#pragma once
2020-06-02 13:15:53 +00:00
#include <thread>
#include <memory>
2020-06-02 13:15:53 +00:00
#include <mutex>
#include <amqpcpp.h>
#include <amqpcpp/libevent.h>
#include <amqpcpp/linux_tcp.h>
#include <common/types.h>
#include <event2/event.h>
namespace DB
{
class RabbitMQHandler : public AMQP::LibEventHandler
{
public:
RabbitMQHandler(event_base * evbase_, Poco::Logger * log_);
void onError(AMQP::TcpConnection * connection, const char * message) override;
void start(std::atomic<bool> & check_param);
void stop();
private:
event_base * evbase;
Poco::Logger * log;
std::mutex mutex;
};
}