The QAbstractGrpcChannel class is an interface that represents common gRPC channel functionality. 更多...
头: | #include <QAbstractGrpcChannel> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS Grpc)
target_link_libraries(mytarget PRIVATE Qt6::Grpc) |
Since: | Qt 6.5 |
继承者: | |
状态: | 技术预览 |
void | addInterceptorManager (const QGrpcClientInterceptorManager & manager ) |
virtual std::shared_ptr<QAbstractProtobufSerializer> | serializer () const = 0 |
(从 6.7 起)
virtual void
|
call (std::shared_ptr<QGrpcChannelOperation> channelOperation ) = 0 |
(从 6.7 起)
virtual void
|
startBidirStream (std::shared_ptr<QGrpcChannelOperation> channelOperation ) = 0 |
(从 6.7 起)
virtual void
|
startClientStream (std::shared_ptr<QGrpcChannelOperation> channelOperation ) = 0 |
(从 6.7 起)
virtual void
|
startServerStream (std::shared_ptr<QGrpcChannelOperation> channelOperation ) = 0 |
Implement this interface to create your own custom channel for gRPC transportation. We provide the QGrpcHttp2Channel , which is a fully featured implementation of the QAbstractGrpcChannel for HTTP/2 communication.
Sets the interceptor manager for the channel.
[pure virtual protected, since 6.7]
void
QAbstractGrpcChannel::
call
(
std::shared_ptr
<
QGrpcChannelOperation
>
channelOperation
)
This pure virtual function is called by public QAbstractGrpcChannel::call method when making unary gRPC call. The channelOperation is the pointer to a channel side QGrpcChannelOperation primitive that is connected with QGrpcCallReply primitive, that is used in QAbstractGrpcClient implementations.
The function should implement the channel-side logic of unary call. The implementation must be asynchronous and must not block the thread where the function was called.
该函数在 Qt 6.7 引入。
[pure virtual noexcept]
std::shared_ptr
<
QAbstractProtobufSerializer
> QAbstractGrpcChannel::
serializer
() const
This pure virtual function shall return a shared pointer to QAbstractProtobufSerializer .
This function is called to obtain the QAbstractProtobufSerializer used to perform serialization and deserialization of the message.
[pure virtual protected, since 6.7]
void
QAbstractGrpcChannel::
startBidirStream
(
std::shared_ptr
<
QGrpcChannelOperation
>
channelOperation
)
This pure virtual function that the starts of the bidirectional stream. The channelOperation is the pointer to a channel side QGrpcChannelOperation primitive that is connected with QGrpcBidirStream primitive, that is used in QAbstractGrpcClient .
The function should implement the channel-side logic of bidirectional stream. The implementation must be asynchronous and must not block the thread where the function was called.
该函数在 Qt 6.7 引入。
[pure virtual protected, since 6.7]
void
QAbstractGrpcChannel::
startClientStream
(
std::shared_ptr
<
QGrpcChannelOperation
>
channelOperation
)
This pure virtual function that the starts of the client-side stream. The channelOperation is the pointer to a channel side QGrpcChannelOperation primitive that is connected with QGrpcClientStream primitive, that is used in QAbstractGrpcClient .
The function should implement the channel-side logic of client-side stream. The implementation must be asynchronous and must not block the thread where the function was called.
该函数在 Qt 6.7 引入。
[pure virtual protected, since 6.7]
void
QAbstractGrpcChannel::
startServerStream
(
std::shared_ptr
<
QGrpcChannelOperation
>
channelOperation
)
This pure virtual function that the starts of the server-side stream. The channelOperation is the pointer to a channel side QGrpcChannelOperation primitive that is connected with QGrpcServerStream primitive, that is used in QAbstractGrpcClient implementations.
The function should implement the channel-side logic of server-side stream. The implementation must be asynchronous and must not block the thread where the function was called.
该函数在 Qt 6.7 引入。