MCPcopy Create free account
hub / github.com/Segs/Segs / invokeMethodAsync

Function invokeMethodAsync

3rd_party/jcon-cpp/src/main.cpp:48–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void invokeMethodAsync(jcon::JsonRpcClient* rpc_client)
49{
50 qsrand(std::time(nullptr));
51
52 auto req = rpc_client->callAsync("getRandomInt", 10);
53
54 req->connect(req.get(), &jcon::JsonRpcRequest::result,
55 [](const QVariant& result) {
56 qDebug() << "result of asynchronous RPC call:" << result;
57 });
58
59 req->connect(req.get(), &jcon::JsonRpcRequest::error,
60 [](int code, const QString& message, const QVariant& data) {
61 qDebug() << "RPC error:" << message
62 << " (" << code << ")";
63 });
64}
65
66void invokeMethodSync(jcon::JsonRpcClient* rpc_client)
67{

Callers 1

mainFunction · 0.85

Calls 2

callAsyncMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected