<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Qt gRPC - get return value of a call asyncronously]]></title><description><![CDATA[<p dir="auto">Hello all,</p>
<p dir="auto">I have an RPC call (StartStream) defined here:<br />
<a href="https://github.com/saleae/logic2-automation/blob/develop/proto/saleae/grpc/saleae.proto#L36" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/saleae/logic2-automation/blob/develop/proto/saleae/grpc/saleae.proto#L36</a></p>
<p dir="auto">it returns a StartCaptureReply.</p>
<p dir="auto">The qtgrpcgen tool generates the following API:</p>
<pre><code>QGrpcStatus StartCapture(const saleae::automation::StartCaptureRequest &amp;arg, saleae::automation::StartCaptureReply *ret);
    std::shared_ptr&lt;QGrpcCallReply&gt; StartCapture(const saleae::automation::StartCaptureRequest &amp;arg);
    Q_INVOKABLE void StartCapture(const saleae::automation::StartCaptureRequest &amp;arg, const QObject *context, const std::function&lt;void(std::shared_ptr&lt;QGrpcCallReply&gt;)&gt; &amp;callback);
</code></pre>
<p dir="auto">I use the following code to call the StartCapture:</p>
<pre><code>auto reply = m_client-&gt;StartCapture(req);
    reply-&gt;subscribe(this,
        [this]() {
            finishExecution(true);
        },
        [this](const QGrpcStatus &amp;status) {
            grpcErrorOccurred(status);
        });
</code></pre>
<p dir="auto">Is there any way to get access to the StartCaptureReply in the slot attached to the  QGrpcCallReply::finished signal (attached by the subscribe)?</p>
]]></description><link>https://forum.qt.io/topic/149077/qt-grpc-get-return-value-of-a-call-asyncronously</link><generator>RSS for Node</generator><lastBuildDate>Mon, 07 Sep 2026 03:47:56 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/149077.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 06 Sep 2023 13:40:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Qt gRPC - get return value of a call asyncronously on Wed, 06 Sep 2023 17:29:53 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Since the callback is a lambda, why don't you pass the reply to it the same way you do for <code>this</code> ?</p>
]]></description><link>https://forum.qt.io/post/771748</link><guid isPermaLink="true">https://forum.qt.io/post/771748</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Wed, 06 Sep 2023 17:29:53 GMT</pubDate></item></channel></rss>