QAbstractGrpcClient Class

The QAbstractGrpcClient class is bridge between gRPC clients and channels. More...

Header: #include <QAbstractGrpcClient>
CMake: find_package(Qt6 REQUIRED COMPONENTS Grpc)
target_link_libraries(mytarget PRIVATE Qt6::Grpc)
Since: Qt 6.5
Inherits: QObject

Public Functions

void attachChannel(const std::shared_ptr<QAbstractGrpcChannel> &channel)


void errorOccurred(const QGrpcStatus &status)

Detailed Description

QAbstractGrpcClient provides a set of functions for client classes generated out of protobuf services. QAbstractGrpcClient enforces thread safety for startStream() and call() methods of generated clients.

Member Function Documentation

void QAbstractGrpcClient::attachChannel(const std::shared_ptr<QAbstractGrpcChannel> &channel)

Attaches channel to client as transport layer for gRPC.

Parameters and return values will be serialized to the channel in a format it supports.

Note: Warning: Qt GRPC doesn't guarantee thread safety on the channel level. You have to invoke the channel-related functions on the same thread as QAbstractGrpcClient.

[signal] void QAbstractGrpcClient::errorOccurred(const QGrpcStatus &status)

Indicates that an error occurred during serialization.

This signal is emitted when an error with status occurs in the channel or during serialization.

See also QGrpcOperation::errorOccurred.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.