make async method calls truly async

This commit is contained in:
Dario Gabriel Lipicar
2026-04-08 18:00:46 -03:00
parent d633575677
commit 1353cc7b53
7 changed files with 413 additions and 4 deletions
+6 -4
View File
@@ -97,10 +97,12 @@ void LogosAPIConsumer::invokeRemoteMethodAsync(const QString& authToken, const Q
return;
}
qDebug() << "[LogosObject] LogosAPIConsumer: async calling via LogosObject::callMethod" << methodName;
QVariant result = plugin->callMethod(authToken, methodName, args, timeout.ms);
plugin->release();
QTimer::singleShot(0, this, [callback, result]() { callback(result); });
qDebug() << "[LogosObject] LogosAPIConsumer: async calling via LogosObject::callMethodAsync" << methodName;
plugin->callMethodAsync(authToken, methodName, args, timeout.ms,
[plugin, callback](QVariant result) {
plugin->release();
callback(result);
});
}
void LogosAPIConsumer::onEvent(LogosObject* originObject, const QString& eventName, std::function<void(const QString&, const QVariantList&)> callback)