Ejemplo n.º 1
0
folly::Future<std::pair<std::string, std::unique_ptr<apache::thrift::transport::THeader>>> MyServiceAsyncClient::header_future_getDataById(apache::thrift::RpcOptions& rpcOptions, int64_t id) {
  folly::Promise<std::pair<std::string, std::unique_ptr<apache::thrift::transport::THeader>>> promise11;
  auto future12 = promise11.getFuture();
  auto callback13 = folly::make_unique<apache::thrift::HeaderFutureCallback<std::string>>(std::move(promise11), recv_wrapped_getDataById, channel_);
  getDataById(rpcOptions, std::move(callback13), id);
  return future12;
}
Ejemplo n.º 2
0
folly::Future<std::string> MyServiceAsyncClient::future_getDataById(apache::thrift::RpcOptions& rpcOptions, int64_t id) {
  folly::Promise<std::string> promise3;
  auto future4 = promise3.getFuture();
  std::unique_ptr<apache::thrift::RequestCallback> callback5(new apache::thrift::FutureCallback<std::string>(std::move(promise3), recv_wrapped_getDataById));
  getDataById(rpcOptions, std::move(callback5), id);
  return std::move(future4);
}
Ejemplo n.º 3
0
folly::Future<std::string> MyServiceAsyncClient::future_getDataById(apache::thrift::RpcOptions& rpcOptions, int64_t id) {
  folly::Promise<std::string> promise8;
  auto future9 = promise8.getFuture();
  auto callback10 = folly::make_unique<apache::thrift::FutureCallback<std::string>>(std::move(promise8), recv_wrapped_getDataById, channel_);
  getDataById(rpcOptions, std::move(callback10), id);
  return future9;
}
Ejemplo n.º 4
0
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);
}
Ejemplo n.º 5
0
void MyServiceAsyncClient::sync_getDataById(apache::thrift::RpcOptions& rpcOptions, std::string& _return, int64_t id) {
  apache::thrift::ClientReceiveState _returnState;
  std::unique_ptr<apache::thrift::RequestCallback> callback2(new apache::thrift::ClientSyncCallback(&_returnState, getChannel()->getEventBase(), false));
  getDataById(rpcOptions, std::move(callback2), id);
  getChannel()->getEventBase()->loopForever();
  if (!_returnState.buf()) {
    assert(_returnState.exception());
    std::rethrow_exception(_returnState.exception());
  }
  recv_getDataById(_return, _returnState);
}
Ejemplo n.º 6
0
void MyServiceAsyncClient::sync_getDataById(apache::thrift::RpcOptions& rpcOptions, std::string& _return, int64_t id) {
  apache::thrift::ClientReceiveState _returnState;
  auto callback7 = folly::make_unique<apache::thrift::ClientSyncCallback>(&_returnState, getChannel()->getEventBase(), false);
  getDataById(rpcOptions, std::move(callback7), 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());
  }
  recv_getDataById(_return, _returnState);
}
Ejemplo n.º 7
0
void MyServiceAsyncClient::getDataById(std::function<void (::apache::thrift::ClientReceiveState&&)> callback, int64_t id) {
  getDataById(folly::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)),id);
}
Ejemplo n.º 8
0
void MyServiceAsyncClient::getDataById(std::unique_ptr<apache::thrift::RequestCallback> callback, int64_t id) {
  ::apache::thrift::RpcOptions rpcOptions;
  getDataById(rpcOptions, std::move(callback), id);
}
Ejemplo n.º 9
0
void MyServiceAsyncClient::getDataById(std::function<void (::apache::thrift::ClientReceiveState&&)> callback, int64_t id) {
  getDataById(std::unique_ptr<apache::thrift::RequestCallback>(new apache::thrift::FunctionReplyCallback(std::move(callback))),id);
}
Ejemplo n.º 10
0
folly::Future<std::unique_ptr<std::string>> MyServiceSvIf::future_getDataById(int64_t id) {
  return apache::thrift::detail::si::future_returning_uptr([&](std::string& _return) { getDataById(_return, id); });
}
Ejemplo n.º 11
0
folly::Future<std::string> MyServiceFastSvIf::future_getDataById(int64_t id) {
  return apache::thrift::detail::si::future_returning([&](std::string& _return) { getDataById(_return, id); });
}