Highly Performance RPC Framework.
Note that this is working on progress.
class Calculator {
public:
int add(int x, int y) {
return x + y;
}
int sub(int x, int y) {
return x - y;
}
};
int main() {
dousi::Init(/*master=*/"127.0.0.1:100001");
auto my_service = dousi::CreateService<Calculator>();
const auto add_rm = dousi::Remote(&Calculator::add);
adder_service.RegisterMethod(add_rm);
adder_service.RegisterMethod(dousi::Remote(&Calculator::sub));
dousi::Loop();
return 0;
}
int main() {
dousi::Init(/*master=*/"127.0.0.1:100001");
ServiceHandle calc_service = dousi::GetService<Calculator>();
DousiFuture<int> sum_future = calc_service.Call(dousi::Remote(&Calculator::add), 2, 3);
DousiFuture<int> sub_future = calc_service.Call(dousi::Remote(&Calculator::sub), 10, 3);
std::cout << "2 + 3 = " << *sum_future.Get() << std::endl;
std::cout << "10 - 3 = " << *sub_future.Get() << std::endl;
return 0;
}
Java Async-Server and Async-Client is supported now, and it's supported that a Java client connects to C++ server and a C++ client connects to a Java server.
More information can be refered in Java Part of Dousi