void MyRootAsyncClient::sync_do_root(apache::thrift::RpcOptions& rpcOptions) { apache::thrift::ClientReceiveState _returnState; std::unique_ptr<apache::thrift::RequestCallback> callback0(new apache::thrift::ClientSyncCallback(&_returnState, getChannel()->getEventBase(), false)); do_root(rpcOptions, std::move(callback0)); getChannel()->getEventBase()->loopForever(); SCOPE_EXIT { if (_returnState.header() && !_returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(_returnState.header()->releaseHeaders()); } }; if (!_returnState.buf()) { assert(_returnState.exception()); std::rethrow_exception(_returnState.exception()); } recv_do_root(_returnState); }
void SaslAuthServiceAsyncClient::sync_authNextRequest(apache::thrift::RpcOptions& rpcOptions, ::apache::thrift::sasl::SaslReply& _return, const ::apache::thrift::sasl::SaslRequest& saslRequest) { apache::thrift::ClientReceiveState _returnState; auto callback = folly::make_unique<apache::thrift::ClientSyncCallback>(&_returnState, getChannel()->getEventBase(), false); authNextRequest(rpcOptions, std::move(callback), saslRequest); getChannel()->getEventBase()->loopForever(); SCOPE_EXIT { if (_returnState.header() && !_returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(_returnState.header()->releaseHeaders()); } }; if (!_returnState.buf()) { assert(_returnState.exception()); std::rethrow_exception(_returnState.exception()); } recv_authNextRequest(_return, _returnState); }
bool MyServiceAsyncClient::sync_hasDataById(apache::thrift::RpcOptions& rpcOptions, int64_t id) { apache::thrift::ClientReceiveState _returnState; auto callback0 = folly::make_unique<apache::thrift::ClientSyncCallback>(&_returnState, getChannel()->getEventBase(), false); hasDataById(rpcOptions, std::move(callback0), id); getChannel()->getEventBase()->loopForever(); SCOPE_EXIT { if (_returnState.header() && !_returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(_returnState.header()->releaseHeaders()); } }; if (!_returnState.buf()) { assert(_returnState.exception()); std::rethrow_exception(_returnState.exception()); } return recv_hasDataById(_returnState); }
void MyServiceAsyncClient::sync_putDataById(apache::thrift::RpcOptions& rpcOptions, int64_t id, const std::string& data) { apache::thrift::ClientReceiveState _returnState; std::unique_ptr<apache::thrift::RequestCallback> callback8(new apache::thrift::ClientSyncCallback(&_returnState, getChannel()->getEventBase(), false)); putDataById(rpcOptions, std::move(callback8), id, data); getChannel()->getEventBase()->loopForever(); SCOPE_EXIT { if (_returnState.header() && !_returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(_returnState.header()->releaseHeaders()); } }; if (!_returnState.buf()) { assert(_returnState.exception()); std::rethrow_exception(_returnState.exception()); } recv_putDataById(_returnState); }
void MyNodeAsyncClient::sync_do_mid(apache::thrift::RpcOptions& rpcOptions) { apache::thrift::ClientReceiveState _returnState; auto callback7 = folly::make_unique<apache::thrift::ClientSyncCallback>(&_returnState, getChannel()->getEventBase(), false); do_mid(rpcOptions, std::move(callback7)); getChannel()->getEventBase()->loopForever(); SCOPE_EXIT { if (_returnState.header() && !_returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(_returnState.header()->releaseHeaders()); } }; if (!_returnState.buf()) { assert(_returnState.exception()); std::rethrow_exception(_returnState.exception()); } recv_do_mid(_returnState); }
void service2AsyncClient::sync_methodF(apache::thrift::RpcOptions& rpcOptions, ::test_cpp2::cpp_reflection::struct2& _return, int32_t l, const ::test_cpp2::cpp_reflection::struct1& m, double n) { apache::thrift::ClientReceiveState _returnState; auto callback182 = folly::make_unique<apache::thrift::ClientSyncCallback>(&_returnState, getChannel()->getEventBase(), false); methodF(rpcOptions, std::move(callback182), l, m, n); getChannel()->getEventBase()->loopForever(); SCOPE_EXIT { if (_returnState.header() && !_returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(_returnState.header()->releaseHeaders()); } }; if (!_returnState.buf()) { assert(_returnState.exception()); std::rethrow_exception(_returnState.exception()); } recv_methodF(_return, _returnState); }