diff options
author | Dominik Holland <dominik.holland@pelagicore.com> | 2019-03-21 15:09:49 +0100 |
---|---|---|
committer | Dominik Holland <dominik.holland@pelagicore.com> | 2019-04-01 12:44:20 +0000 |
commit | 77d182798fa45a7dc16b65aefd35639a77c2fed2 (patch) | |
tree | 31e5ad882b493dc06a79da499f2e7f2d6fa52b25 /examples/ivicore/qface-ivi-remote/server_qtro/processingservice.h | |
parent | bdf25ced227fbd0b5ec7ec36fe658e62bd763838 (diff) | |
download | qtivi-77d182798fa45a7dc16b65aefd35639a77c2fed2.tar.gz |
ivigenerator: Add support for pending server replies
By default QtRemoteObjects always wants to return a result for
a function call right away. For function calls which take longer
this doesn't work very well as the Qt main event loop is blocked
until the result is ready and in the meantime no other communication
can take place.
This commit introduces a workaround for this limitation by
generating a interface specific PendingResult object which can
be returned as a placeholder to inform the client that the result
is not yet ready. The actual result is emitted by the server using
the pendingResultAvailable signal with the call-id and the result.
To also support returning the result right away the return value
always needs to be of type QVariant. This also has the good side
effect that the client side always gets informed of whether a
call has been finished or not as QtRemoteObjects doesn't provide
QRemoteObjectPendingReply<void> for this.
Change-Id: I68bf29b84b95042b69b5e1a18096f48ee9da7c7c
Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
Diffstat (limited to 'examples/ivicore/qface-ivi-remote/server_qtro/processingservice.h')
-rw-r--r-- | examples/ivicore/qface-ivi-remote/server_qtro/processingservice.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/ivicore/qface-ivi-remote/server_qtro/processingservice.h b/examples/ivicore/qface-ivi-remote/server_qtro/processingservice.h index 8c7f6b2..1f65e82 100644 --- a/examples/ivicore/qface-ivi-remote/server_qtro/processingservice.h +++ b/examples/ivicore/qface-ivi-remote/server_qtro/processingservice.h @@ -60,7 +60,7 @@ class ProcessingService : public ProcessingServiceSimpleSource public: ProcessingService(); - int process(const QString & data) override; + QVariant process(const QString & data) override; }; //! [0] #endif // PROCESSINGSERVICE_H |