blob: 9a14e8cbc193d5dd7b68f7e062dfe44dc9696d09 [file] [log] [blame]
#pragma once
#include <functional>
#include "absl/container/flat_hash_set.h"
#include "ClientConfig.h"
ROCKETMQ_NAMESPACE_BEGIN
class Client : virtual public ClientConfig {
public:
~Client() override = default;
virtual void endpointsInUse(absl::flat_hash_set<std::string>& endpoints) = 0;
virtual void heartbeat() = 0;
virtual bool active() = 0;
virtual void onRemoteEndpointRemoval(const std::vector<std::string>&) = 0;
/**
* For endpoints that are marked as inactive due to one or multiple business operation failure, this function is to
* initiate health-check RPCs; Once the health-check passes, they are conceptually add back to serve further business
* workload.
*/
virtual void healthCheck() = 0;
virtual void schedule(const std::string& task_name, const std::function<void(void)>& task,
std::chrono::milliseconds delay) = 0;
};
ROCKETMQ_NAMESPACE_END