Skip to content

[RFC] Integrate dyanmic loading to let users easy to use. #208

Description

@jovany-wang

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() {
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions