Пример #1
0
folly::Future<std::pair<int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service2AsyncClient::header_future_methodC(apache::thrift::RpcOptions& rpcOptions) {
  folly::Promise<std::pair<int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise165;
  auto future166 = promise165.getFuture();
  auto callback167 = folly::make_unique<apache::thrift::HeaderFutureCallback<int32_t>>(std::move(promise165), recv_wrapped_methodC, channel_);
  methodC(rpcOptions, std::move(callback167));
  return future166;
}
Пример #2
0
folly::Future<int32_t> service2AsyncClient::future_methodC(apache::thrift::RpcOptions& rpcOptions) {
  folly::Promise<int32_t> promise162;
  auto future163 = promise162.getFuture();
  auto callback164 = folly::make_unique<apache::thrift::FutureCallback<int32_t>>(std::move(promise162), recv_wrapped_methodC, channel_);
  methodC(rpcOptions, std::move(callback164));
  return future163;
}
Пример #3
0
int32_t service2AsyncClient::sync_methodC(apache::thrift::RpcOptions& rpcOptions) {
  apache::thrift::ClientReceiveState _returnState;
  auto callback161 = folly::make_unique<apache::thrift::ClientSyncCallback>(&_returnState, getChannel()->getEventBase(), false);
  methodC(rpcOptions, std::move(callback161));
  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_methodC(_returnState);
}
Пример #4
0
folly::Future<int32_t> service2SvIf::future_methodC() {
  return apache::thrift::detail::si::future([&] { return methodC(); });
}
Пример #5
0
void service2AsyncClient::methodC(std::function<void (::apache::thrift::ClientReceiveState&&)> callback) {
  methodC(folly::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
}
Пример #6
0
void service2AsyncClient::methodC(std::unique_ptr<apache::thrift::RequestCallback> callback) {
  ::apache::thrift::RpcOptions rpcOptions;
  methodC(rpcOptions, std::move(callback));
}