This RFC aims to discuss how we support the very easy to use RAFT service.
I propose this simple usage:
// my_counter_service.hclassMyCounterService {
public:virtualintget() const = 0;
virtualvoidincr(int delta) = 0;
};// my_counter_service_impl.hclassMyCounterServiceImpl : publicMyCounterService {
public:intget() const { return val_; }
voidincr(int delta) { val_ += delta; }
private:int val_ = 0;
};
INIT_RAFT_SERVICE(MyCounterService, MyCounterService::incr, MyCounterService::get);
/// server.h
#include"my_counter_service_impl.h"intmain() {
raftcpp::Loop();
}/// client.h
#include"my_counter_service.h"intmain() {
}
This RFC aims to discuss how we support the very easy to use RAFT service.
I propose this simple usage: