QGrpcStartInterceptor Class
RPC의 시작을 가로챕니다. 더 보기...
| 헤더: | #include <QGrpcInterceptor> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Grpc) target_link_libraries(mytarget PRIVATE Qt6::Grpc) |
| 다음부터: | Qt 6.11 |
- 상속된 멤버를 포함한 모든 멤버 목록
- QGrpcStartInterceptor는 'Qt GRPC ' 인터셉터에 속합니다.
참고: 이 클래스의 모든 함수는 재진입 가능합니다.
공개 유형
(since 6.11) enum class | Continuation { Proceed, Drop } |
공개 함수
| virtual | ~QGrpcStartInterceptor() |
| virtual QGrpcStartInterceptor::Continuation | onStart(QGrpcInterceptionContext &context, QProtobufMessage &message, QGrpcCallOptions &callOptions) = 0 |
상세 설명
QGrpcStartInterceptor를 구현하여 RPC가 시작될 때 사용되는 매개 변수를 관찰하거나 조정할 수 있습니다.
인터셉터는 RPC가 호출되기 전에 RPC당 한 번씩 호출됩니다.
인터셉션 메커니즘에 대한 소개와 인터셉터 인터페이스가 RPC의 라이프사이클에 참여하는 방식에 대한 내용은 ‘Qt GRPC ’의 인터셉터 개요를 참조하십시오.
참고: 이 인터셉터는 아웃바운드 방향으로 작동합니다. 여러 인터셉터 콜백이 체인을 통해 흐르는 방식에 대한 자세한 내용은 ‘방향 및 흐름’ 섹션을 참조하십시오.
또한 QtGrpc::InterceptorCapability::Start 및 QGrpcInterceptionContext 을참조하십시오 .
멤버 유형 문서
[since 6.11] enum class QGrpcStartInterceptor::Continuation
차단된 RPC가 계속 진행되어야 하는지 여부를 제어합니다.
| 상수 | 값 | 설명 |
|---|---|---|
QGrpcStartInterceptor::Continuation::Proceed | 0 | 호출을 계속합니다. |
QGrpcStartInterceptor::Continuation::Drop | 1 | 호출을 중단합니다. |
이 열거형은 Qt 6.11에서 도입되었습니다.
멤버 함수 문서
[virtual noexcept] QGrpcStartInterceptor::~QGrpcStartInterceptor()
요격기를 파괴한다.
[pure virtual] QGrpcStartInterceptor::Continuation QGrpcStartInterceptor::onStart(QGrpcInterceptionContext &context, QProtobufMessage &message, QGrpcCallOptions &callOptions)
RPC가 시작되기 직전에 호출됩니다.
context 는 가로채진 RPC에 대한 정보를 제공합니다.
message 에는 초기 요청 메시지가 포함되어 있으며, 그 자리에서 수정할 수 있습니다.
callOptions 는 호출별 설정을 조정하기 위해 수정할 수 있습니다.
RPC를 계속 진행하려면 ` Continuation::Proceed `를 반환하고, 진행을 중지하려면 ` Continuation::Drop `를 반환하십시오.
Continuation::Drop 가 반환되면 RPC가 중단되고 작업이 finished()로 전환됩니다. 결과 상태 코드는 Aborted 입니다. QGrpcFinishedInterceptor 를 구현하는 인터셉터는 여전히 호출됩니다.
참고: 가변형 callOptions 는 context.callOptions() 에서 반환된 것과 동일한 호출 옵션 인스턴스를 가리킵니다.
© 2026 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.