Skip to content

A simple library for kind of remote procedure call, better to say procedure of another process of the same system. Primary targets are simple qt-based applications written for mere system interface.

License

Notifications You must be signed in to change notification settings

merelabs/mere-rpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mere-rpc-lib

mere-rpc-lib is a simple RPC library for Qt application based on mere-message-lib.

Example

Server

A simple local server that hosts a sample auth service and to accept request to perform user's authentication;

#include "mere/rpc/server.h"
#include "authservice.h"

int main()
{
    Mere::RPC::Server server = new Mere::RPC::Server("mms://local");
    
    // register service
    AuthService *authService= new AuthService();
    server->add("auth", authService);
    
    // Just start it!
    server->start();
}

Client

A simple might look like as following; here client is communicating server local that hosts authentication service named as auth, the name of the method we would like to call is authenticate and it accepts two arguments that we pass as positional arguments.

#include "mere/rpc/client.h"

int main()
{
    Mere::RPC::Client client = new Mere::RPC::Client("mms://local/auth");
    client->method("authenticate")->with({"user", "123456"})->call([](QVariant res, QVariant err){
        qDebug() << "Got it:" << res << err;
    });
}

Status

It is still in beta state.

Reference

About

A simple library for kind of remote procedure call, better to say procedure of another process of the same system. Primary targets are simple qt-based applications written for mere system interface.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published