Is there an ability to delay response when I use QJsonRpcService?
Here is an example:
class MyService : public QJsonRpcService
{
...
public slots:
void mySlot()
{
//can I get the request id here?
//I use a lambda here, because the task I am going to do is async
//and I want to create a response from the lambda
//is this possible?
//I only found how to get the sender socket - senderSocket()
}
}
Hello
Is there an ability to delay response when I use QJsonRpcService?
Here is an example:
class MyService : public QJsonRpcService
{
...
public slots:
void mySlot()
{
//can I get the request id here?
//I use a lambda here, because the task I am going to do is async
//and I want to create a response from the lambda
//is this possible?
//I only found how to get the sender socket - senderSocket()
}
}
--
You received this message because you are subscribed to the Google Groups "qjsonrpc-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qjsonrpc-develop...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Matt,
I'm using delayed responses right now on my project.
I have methods called via QJsonRPC, some of them require long execution times, thus I manually handle the response:
bool MyRpcService::longActionRequest(void)
{
bool res = 0;
QJsonRpcServiceRequest request;
beginDelayedResponse();
request = currentRequest();
if (m_engine->metaObject()->indexOfMethod(QMetaObject::normalizedSignature("longAction()").constData()) != -1) {
QMetaObject::invokeMethod(m_engine, "longAction", Qt::AutoConnection,
Q_RETURN_ARG(bool, res));
}
request.respond(res);
return (res);
}