folly::Future<std::pair<bool, std::unique_ptr<apache::thrift::transport::THeader>>> MyServiceAsyncClient::header_future_hasDataById(apache::thrift::RpcOptions& rpcOptions, int64_t id) { folly::Promise<std::pair<bool, std::unique_ptr<apache::thrift::transport::THeader>>> promise4; auto future5 = promise4.getFuture(); auto callback6 = folly::make_unique<apache::thrift::HeaderFutureCallback<bool>>(std::move(promise4), recv_wrapped_hasDataById, channel_); hasDataById(rpcOptions, std::move(callback6), id); return future5; }
folly::Future<bool> MyServiceAsyncClient::future_hasDataById(apache::thrift::RpcOptions& rpcOptions, int64_t id) { folly::Promise<bool> promise1; auto future2 = promise1.getFuture(); auto callback3 = folly::make_unique<apache::thrift::FutureCallback<bool>>(std::move(promise1), recv_wrapped_hasDataById, channel_); hasDataById(rpcOptions, std::move(callback3), id); return future2; }
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); }
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::hasDataById(std::function<void (::apache::thrift::ClientReceiveState&&)> callback, int64_t id) { hasDataById(folly::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)),id); }
void MyServiceAsyncClient::hasDataById(std::function<void (::apache::thrift::ClientReceiveState&&)> callback, int64_t id) { hasDataById(std::unique_ptr<apache::thrift::RequestCallback>(new apache::thrift::FunctionReplyCallback(std::move(callback))),id); }
folly::Future<bool> MyServiceSvIf::future_hasDataById(int64_t id) { return apache::thrift::detail::si::future([&] { return hasDataById(id); }); }