コード例 #1
0
ファイル: MyService_client.cpp プロジェクト: nemith/fbthrift
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);
}
コード例 #2
0
ファイル: MyService_client.cpp プロジェクト: Bklyn/fbthrift
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);
}
コード例 #3
0
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);
}
コード例 #4
0
ファイル: service2_client.cpp プロジェクト: disigma/fbthrift
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);
}
コード例 #5
0
ファイル: MyRoot_client.cpp プロジェクト: nemith/fbthrift
folly::Future<folly::Unit> MyRootAsyncClient::future_do_root(apache::thrift::RpcOptions& rpcOptions) {
  folly::Promise<folly::Unit> promise1;
  auto future2 = promise1.getFuture();
  std::unique_ptr<apache::thrift::RequestCallback> callback3(new apache::thrift::FutureCallback<folly::Unit>(std::move(promise1), recv_wrapped_do_root, channel_, (rpcOptions.getUseForReadHeaders() ? &rpcOptions : nullptr)));
  do_root(rpcOptions, std::move(callback3));
  return std::move(future2);
}
コード例 #6
0
ファイル: MyService_client.cpp プロジェクト: nemith/fbthrift
folly::Future<bool> MyServiceAsyncClient::future_hasDataById(apache::thrift::RpcOptions& rpcOptions, int64_t id) {
  folly::Promise<bool> promise1;
  auto future2 = promise1.getFuture();
  std::unique_ptr<apache::thrift::RequestCallback> callback3(new apache::thrift::FutureCallback<bool>(std::move(promise1), recv_wrapped_hasDataById, channel_, (rpcOptions.getUseForReadHeaders() ? &rpcOptions : nullptr)));
  hasDataById(rpcOptions, std::move(callback3), id);
  return std::move(future2);
}
コード例 #7
0
ファイル: MyService_client.cpp プロジェクト: nemith/fbthrift
folly::Future<folly::Unit> MyServiceAsyncClient::future_putDataById(apache::thrift::RpcOptions& rpcOptions, int64_t id, const std::string& data) {
  folly::Promise<folly::Unit> promise9;
  auto future10 = promise9.getFuture();
  std::unique_ptr<apache::thrift::RequestCallback> callback11(new apache::thrift::FutureCallback<folly::Unit>(std::move(promise9), recv_wrapped_putDataById, channel_, (rpcOptions.getUseForReadHeaders() ? &rpcOptions : nullptr)));
  putDataById(rpcOptions, std::move(callback11), id, data);
  return std::move(future10);
}
コード例 #8
0
ファイル: MyService_client.cpp プロジェクト: nemith/fbthrift
folly::Future<std::string> MyServiceAsyncClient::future_getDataById(apache::thrift::RpcOptions& rpcOptions, int64_t id) {
  folly::Promise<std::string> promise5;
  auto future6 = promise5.getFuture();
  std::unique_ptr<apache::thrift::RequestCallback> callback7(new apache::thrift::FutureCallback<std::string>(std::move(promise5), recv_wrapped_getDataById, channel_, (rpcOptions.getUseForReadHeaders() ? &rpcOptions : nullptr)));
  getDataById(rpcOptions, std::move(callback7), id);
  return std::move(future6);
}