QtProtobuf  0.6
Protobuf plugin to generate Qt classes
Public Member Functions | List of all members
QtProtobuf::QGrpcHttp2Channel Class Referencefinal

The QGrpcHttp2Channel class is HTTP/2 implementation of QAbstractGrpcChannel interface. More...

#include <qgrpchttp2channel.h>

Inheritance diagram for QtProtobuf::QGrpcHttp2Channel:
Inheritance graph
[legend]
Collaboration diagram for QtProtobuf::QGrpcHttp2Channel:
Collaboration graph
[legend]

Public Member Functions

 QGrpcHttp2Channel (const QUrl &url, std::unique_ptr< QAbstractGrpcCredentials > credentials)
 QGrpcHttp2Channel constructs QGrpcHttp2Channel. 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< QAbstractProtobufSerializerserializer () const override
 
- Public Member Functions inherited from QtProtobuf::QAbstractGrpcChannel
const QThread * thread () const
 

Detailed Description

The QGrpcHttp2Channel class is HTTP/2 implementation of QAbstractGrpcChannel interface.

For QGrpcHttp2Channel utilizes channel and call credentials. For channel credential QGrpcHttp2Channel supports SslConfigCredential key. When https is used, this key has to be explicitly specified and provide QSslConfiguration and value. Provided QSslConfiguration will be used to establish HTTP/2 secured connection. All keys passed as QGrpcCallCredentials will be used as HTTP/2 headers with related values assigned.

Constructor & Destructor Documentation

◆ QGrpcHttp2Channel()

QGrpcHttp2Channel::QGrpcHttp2Channel ( const QUrl &  url,
std::unique_ptr< QAbstractGrpcCredentials >  credentials 
)

QGrpcHttp2Channel constructs QGrpcHttp2Channel.

Parameters
urlhttp/https url used to establish channel connection
credentialscall/channel credentials pair

Member Function Documentation

◆ call() [1/2]

QGrpcStatus QGrpcHttp2Channel::call ( const QString &  method,
const QString &  service,
const QByteArray &  args,
QByteArray &  ret 
)
overridevirtual

Calls method synchronously with given serialized message args and write result of call to ret.

Note
This method is synchronous, that means it doesn't return until call is completed or aborted by timeout if it's implemented in inherited channel.
This method should not be called directly.
Parameters
[in]methodremote method is called
[in]serviceservice identified in URL path format
[in]argsserialized argument message
[out]retoutput bytearray to collect returned message
Returns
returns gRPC QAbstractGrpcChannel::Status code for operation

Implements QtProtobuf::QAbstractGrpcChannel.

◆ call() [2/2]

void QGrpcHttp2Channel::call ( const QString &  method,
const QString &  service,
const QByteArray &  args,
QtProtobuf::QGrpcAsyncReply ret 
)
overridevirtual

Calls method asynchronously with given serialized messge args.

Result of method call is written to QGrpcAsyncReply.

Note
This method is asynchronous, that means it returns control imediately after it is called.
This method should not be called directly.
Parameters
[in]methodremote method is called
[in]serviceservice identified in URL path format
[in]argsserialized argument message
[out]retQGrpcAsyncReply that will be returned to end-point user to read data once call complete. QGrpcAsyncReply lifecycle is managed by QAbstractGrpcClient only.
See also
QGrpcAsyncReply for details

Implements QtProtobuf::QAbstractGrpcChannel.

◆ subscribe()

void QGrpcHttp2Channel::subscribe ( QGrpcSubscription subscription,
const QString &  service,
QAbstractGrpcClient client 
)
overridevirtual

Subscribes to server-side stream to receive updates for given method.

Note
This method should not be called directly.
Parameters
[in]methodremote method is called
[in]serviceservice identified in URL path format
[in]argsserialized argument message
[in]handlercallback that will be called when message recevied from the server-stream

Implements QtProtobuf::QAbstractGrpcChannel.


The documentation for this class was generated from the following files: