The QGrpcChannel class is a gRPC-cpp native api implementation of QAbstractGrpcChannel interface. More...
#include <qgrpcchannel.h>
Public Member Functions | |
QGrpcChannel (const QUrl &name, std::shared_ptr< grpc::ChannelCredentials > credentials) | |
QGrpcChannel constructs QGrpcChannel. More... | |
QGrpcStatus | call (const QString &method, const QString &service, const QByteArray &args, QByteArray &ret) override |
Calls method synchronously with given serialized message args and write result of call to ret . More... | |
void | call (const QString &method, const QString &service, const QByteArray &args, QtProtobuf::QGrpcAsyncReply *reply) override |
Calls method asynchronously with given serialized messge args . More... | |
void | subscribe (QGrpcSubscription *subscription, const QString &service, QAbstractGrpcClient *client) override |
Subscribes to server-side stream to receive updates for given method . More... | |
std::shared_ptr< QAbstractProtobufSerializer > | serializer () const override |
Public Member Functions inherited from QtProtobuf::QAbstractGrpcChannel | |
const QThread * | thread () const |
The QGrpcChannel class is a gRPC-cpp native api implementation of QAbstractGrpcChannel interface.
QGrpcChannel accepts the same grpc::ChannelCredentials type that is required by native-api grpc::CreateChannel. See https://grpc.github.io/grpc/cpp/classgrpc__impl_1_1_channel_credentials.html.
QtProtobuf::QGrpcChannel::QGrpcChannel | ( | const QUrl & | name, |
std::shared_ptr< grpc::ChannelCredentials > | credentials | ||
) |
QGrpcChannel constructs QGrpcChannel.
name | uri used to establish channel connection |
credentials | grpc credientials object |
|
overridevirtual |
Calls method
synchronously with given serialized message args
and write result of call to ret
.
[in] | method | remote method is called |
[in] | service | service identified in URL path format |
[in] | args | serialized argument message |
[out] | ret | output bytearray to collect returned message |
Implements QtProtobuf::QAbstractGrpcChannel.
|
overridevirtual |
Calls method
asynchronously with given serialized messge args
.
Result of method call is written to QGrpcAsyncReply.
[in] | method | remote method is called |
[in] | service | service identified in URL path format |
[in] | args | serialized argument message |
[out] | ret | QGrpcAsyncReply that will be returned to end-point user to read data once call complete. QGrpcAsyncReply lifecycle is managed by QAbstractGrpcClient only. |
Implements QtProtobuf::QAbstractGrpcChannel.
|
overridevirtual |
Subscribes to server-side stream to receive updates for given method
.
[in] | method | remote method is called |
[in] | service | service identified in URL path format |
[in] | args | serialized argument message |
[in] | handler | callback that will be called when message recevied from the server-stream |
Implements QtProtobuf::QAbstractGrpcChannel.