3 #include <kafka/Project.h>
8 namespace KAFKA_API {
namespace clients {
19 using ThreadStartCb = std::function<void(
const std::string&,
const std::string&)>;
24 using ThreadExitCb = std::function<void(
const std::string&,
const std::string&)>;
29 using BrokerStateChangeCb = std::function<void(
int,
const std::string&,
const std::string&,
int,
const std::string&)>;
64 bool empty()
const {
return !_valid; }
Interceptors for Kafka clients.
Definition: Interceptors.h:14
std::function< void(const std::string &, const std::string &)> ThreadExitCb
Callback type for thread-exit interceptor.
Definition: Interceptors.h:24
Interceptors & onBrokerStateChange(BrokerStateChangeCb cb)
Set interceptor for broker state change.
Definition: Interceptors.h:44
Interceptors & onThreadStart(ThreadStartCb cb)
Set interceptor for thread start.
Definition: Interceptors.h:34
Interceptors & onThreadExit(ThreadExitCb cb)
Set interceptor for thread exit.
Definition: Interceptors.h:39
BrokerStateChangeCb onBrokerStateChange() const
Get interceptor for broker state change.
Definition: Interceptors.h:59
ThreadExitCb onThreadExit() const
Get interceptor for thread exit.
Definition: Interceptors.h:54
std::function< void(int, const std::string &, const std::string &, int, const std::string &)> BrokerStateChangeCb
Callback type for broker-state-change interceptor.
Definition: Interceptors.h:29
bool empty() const
Check if there's no interceptor.
Definition: Interceptors.h:64
std::function< void(const std::string &, const std::string &)> ThreadStartCb
Callback type for thread-start interceptor.
Definition: Interceptors.h:19
ThreadStartCb onThreadStart() const
Get interceptor for thread start.
Definition: Interceptors.h:49