/** * Autogenerated by Thrift for src/module.thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @nocommit */ #include "thrift/compiler/test/fixtures/fatal/gen-cpp2/service1AsyncClient.h" #include namespace test_cpp2 { namespace cpp_reflection { typedef apache::thrift::ThriftPresult service1_method1_pargs; typedef apache::thrift::ThriftPresult service1_method1_presult; typedef apache::thrift::ThriftPresult, apache::thrift::FieldData<2, ::apache::thrift::type_class::structure, ::test_cpp2::cpp_reflection::struct1*>, apache::thrift::FieldData<3, ::apache::thrift::type_class::floating_point, double*>> service1_method2_pargs; typedef apache::thrift::ThriftPresult service1_method2_presult; typedef apache::thrift::ThriftPresult service1_method3_pargs; typedef apache::thrift::ThriftPresult> service1_method3_presult; typedef apache::thrift::ThriftPresult, apache::thrift::FieldData<2, ::apache::thrift::type_class::structure, ::test_cpp2::cpp_reflection::struct1*>, apache::thrift::FieldData<3, ::apache::thrift::type_class::floating_point, double*>> service1_method4_pargs; typedef apache::thrift::ThriftPresult> service1_method4_presult; typedef apache::thrift::ThriftPresult service1_method5_pargs; typedef apache::thrift::ThriftPresult> service1_method5_presult; typedef apache::thrift::ThriftPresult, apache::thrift::FieldData<2, ::apache::thrift::type_class::structure, ::test_cpp2::cpp_reflection::struct1*>, apache::thrift::FieldData<3, ::apache::thrift::type_class::floating_point, double*>> service1_method6_pargs; typedef apache::thrift::ThriftPresult> service1_method6_presult; template void service1AsyncClient::method1T(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) { service1_method1_pargs args; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "method1", ::apache::thrift::FunctionQualifier::Unspecified); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } template void service1AsyncClient::method2T(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { service1_method2_pargs args; args.get<0>().value = &p_x; args.get<1>().value = const_cast<::test_cpp2::cpp_reflection::struct1*>(&p_y); args.get<2>().value = &p_z; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "method2", ::apache::thrift::FunctionQualifier::Unspecified); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } template void service1AsyncClient::method3T(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) { service1_method3_pargs args; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "method3", ::apache::thrift::FunctionQualifier::Unspecified); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } template void service1AsyncClient::method4T(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { service1_method4_pargs args; args.get<0>().value = &p_i; args.get<1>().value = const_cast<::test_cpp2::cpp_reflection::struct1*>(&p_j); args.get<2>().value = &p_k; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "method4", ::apache::thrift::FunctionQualifier::Unspecified); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } template void service1AsyncClient::method5T(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) { service1_method5_pargs args; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "method5", ::apache::thrift::FunctionQualifier::Unspecified); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } template void service1AsyncClient::method6T(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { service1_method6_pargs args; args.get<0>().value = &p_l; args.get<1>().value = const_cast<::test_cpp2::cpp_reflection::struct1*>(&p_m); args.get<2>().value = &p_n; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "method6", ::apache::thrift::FunctionQualifier::Unspecified); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } void service1AsyncClient::method1(std::unique_ptr callback) { ::apache::thrift::RpcOptions rpcOptions; method1(rpcOptions, std::move(callback)); } void service1AsyncClient::method1(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback) { auto [ctx, header] = method1Ctx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)); method1Impl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback)); } void service1AsyncClient::method1Impl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { method1T(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback)); } else { method1T(&writer, rpcOptions, std::move(header), contextStack, std::move(callback)); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { method1T(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback)); } else { method1T(&writer, rpcOptions, std::move(header), contextStack, std::move(callback)); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair, std::shared_ptr<::apache::thrift::transport::THeader>> service1AsyncClient::method1Ctx(apache::thrift::RpcOptions* rpcOptions) { auto header = std::make_shared( apache::thrift::transport::THeader::ALLOW_BIG_FRAMES); header->setProtocolId(channel_->getProtocolId()); if (rpcOptions) { header->setHeaders(rpcOptions->releaseWriteHeaders()); } auto ctx = apache::thrift::ContextStack::createWithClientContext( handlers_, getServiceName(), "service1.method1", *header); return {std::move(ctx), std::move(header)}; } void service1AsyncClient::sync_method1() { ::apache::thrift::RpcOptions rpcOptions; sync_method1(rpcOptions); } void service1AsyncClient::sync_method1(apache::thrift::RpcOptions& rpcOptions) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = method1Ctx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); callback.waitUntilDone( evb, [&] { method1Impl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback)); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { recv_method1(returnState); }); } folly::Future service1AsyncClient::future_method1() { ::apache::thrift::RpcOptions rpcOptions; return future_method1(rpcOptions); } folly::SemiFuture service1AsyncClient::semifuture_method1() { ::apache::thrift::RpcOptions rpcOptions; return semifuture_method1(rpcOptions); } folly::Future service1AsyncClient::future_method1(apache::thrift::RpcOptions& rpcOptions) { folly::Promise promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_method1, channel_); method1(rpcOptions, std::move(callback)); return future; } folly::SemiFuture service1AsyncClient::semifuture_method1(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_method1, channel_); auto callback = std::move(callbackAndFuture.first); method1(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } folly::Future>> service1AsyncClient::header_future_method1(apache::thrift::RpcOptions& rpcOptions) { folly::Promise>> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_method1, channel_); method1(rpcOptions, std::move(callback)); return future; } folly::SemiFuture>> service1AsyncClient::header_semifuture_method1(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_method1, channel_); auto callback = std::move(callbackAndFuture.first); method1(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } void service1AsyncClient::method1(folly::Function callback) { method1(std::make_unique(std::move(callback))); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper service1AsyncClient::recv_wrapped_method1(::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } if (!state.hasResponseBuffer()) { return folly::make_exception_wrapper("recv_ called without result"); } using result = service1_method1_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } void service1AsyncClient::recv_method1(::apache::thrift::ClientReceiveState& state) { auto ew = recv_wrapped_method1(state); if (ew) { ew.throw_exception(); } } void service1AsyncClient::recv_instance_method1(::apache::thrift::ClientReceiveState& state) { recv_method1(state); } folly::exception_wrapper service1AsyncClient::recv_instance_wrapped_method1(::apache::thrift::ClientReceiveState& state) { return recv_wrapped_method1(state); } void service1AsyncClient::method2(std::unique_ptr callback, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { ::apache::thrift::RpcOptions rpcOptions; method2(rpcOptions, std::move(callback), p_x, p_y, p_z); } void service1AsyncClient::method2(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { auto [ctx, header] = method2Ctx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)); method2Impl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback), p_x, p_y, p_z); } void service1AsyncClient::method2Impl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { method2T(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_x, p_y, p_z); } else { method2T(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_x, p_y, p_z); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { method2T(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_x, p_y, p_z); } else { method2T(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_x, p_y, p_z); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair, std::shared_ptr<::apache::thrift::transport::THeader>> service1AsyncClient::method2Ctx(apache::thrift::RpcOptions* rpcOptions) { auto header = std::make_shared( apache::thrift::transport::THeader::ALLOW_BIG_FRAMES); header->setProtocolId(channel_->getProtocolId()); if (rpcOptions) { header->setHeaders(rpcOptions->releaseWriteHeaders()); } auto ctx = apache::thrift::ContextStack::createWithClientContext( handlers_, getServiceName(), "service1.method2", *header); return {std::move(ctx), std::move(header)}; } void service1AsyncClient::sync_method2(::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { ::apache::thrift::RpcOptions rpcOptions; sync_method2(rpcOptions, p_x, p_y, p_z); } void service1AsyncClient::sync_method2(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = method2Ctx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); callback.waitUntilDone( evb, [&] { method2Impl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback), p_x, p_y, p_z); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { recv_method2(returnState); }); } folly::Future service1AsyncClient::future_method2(::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { ::apache::thrift::RpcOptions rpcOptions; return future_method2(rpcOptions, p_x, p_y, p_z); } folly::SemiFuture service1AsyncClient::semifuture_method2(::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { ::apache::thrift::RpcOptions rpcOptions; return semifuture_method2(rpcOptions, p_x, p_y, p_z); } folly::Future service1AsyncClient::future_method2(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { folly::Promise promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_method2, channel_); method2(rpcOptions, std::move(callback), p_x, p_y, p_z); return future; } folly::SemiFuture service1AsyncClient::semifuture_method2(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_method2, channel_); auto callback = std::move(callbackAndFuture.first); method2(rpcOptions, std::move(callback), p_x, p_y, p_z); return std::move(callbackAndFuture.second); } folly::Future>> service1AsyncClient::header_future_method2(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { folly::Promise>> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_method2, channel_); method2(rpcOptions, std::move(callback), p_x, p_y, p_z); return future; } folly::SemiFuture>> service1AsyncClient::header_semifuture_method2(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_method2, channel_); auto callback = std::move(callbackAndFuture.first); method2(rpcOptions, std::move(callback), p_x, p_y, p_z); return std::move(callbackAndFuture.second); } void service1AsyncClient::method2(folly::Function callback, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { method2(std::make_unique(std::move(callback)), p_x, p_y, p_z); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper service1AsyncClient::recv_wrapped_method2(::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } if (!state.hasResponseBuffer()) { return folly::make_exception_wrapper("recv_ called without result"); } using result = service1_method2_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } void service1AsyncClient::recv_method2(::apache::thrift::ClientReceiveState& state) { auto ew = recv_wrapped_method2(state); if (ew) { ew.throw_exception(); } } void service1AsyncClient::recv_instance_method2(::apache::thrift::ClientReceiveState& state) { recv_method2(state); } folly::exception_wrapper service1AsyncClient::recv_instance_wrapped_method2(::apache::thrift::ClientReceiveState& state) { return recv_wrapped_method2(state); } void service1AsyncClient::method3(std::unique_ptr callback) { ::apache::thrift::RpcOptions rpcOptions; method3(rpcOptions, std::move(callback)); } void service1AsyncClient::method3(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback) { auto [ctx, header] = method3Ctx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)); method3Impl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback)); } void service1AsyncClient::method3Impl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { method3T(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback)); } else { method3T(&writer, rpcOptions, std::move(header), contextStack, std::move(callback)); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { method3T(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback)); } else { method3T(&writer, rpcOptions, std::move(header), contextStack, std::move(callback)); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair, std::shared_ptr<::apache::thrift::transport::THeader>> service1AsyncClient::method3Ctx(apache::thrift::RpcOptions* rpcOptions) { auto header = std::make_shared( apache::thrift::transport::THeader::ALLOW_BIG_FRAMES); header->setProtocolId(channel_->getProtocolId()); if (rpcOptions) { header->setHeaders(rpcOptions->releaseWriteHeaders()); } auto ctx = apache::thrift::ContextStack::createWithClientContext( handlers_, getServiceName(), "service1.method3", *header); return {std::move(ctx), std::move(header)}; } ::std::int32_t service1AsyncClient::sync_method3() { ::apache::thrift::RpcOptions rpcOptions; return sync_method3(rpcOptions); } ::std::int32_t service1AsyncClient::sync_method3(apache::thrift::RpcOptions& rpcOptions) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = method3Ctx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); callback.waitUntilDone( evb, [&] { method3Impl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback)); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { return recv_method3(returnState); }); } folly::Future<::std::int32_t> service1AsyncClient::future_method3() { ::apache::thrift::RpcOptions rpcOptions; return future_method3(rpcOptions); } folly::SemiFuture<::std::int32_t> service1AsyncClient::semifuture_method3() { ::apache::thrift::RpcOptions rpcOptions; return semifuture_method3(rpcOptions); } folly::Future<::std::int32_t> service1AsyncClient::future_method3(apache::thrift::RpcOptions& rpcOptions) { folly::Promise<::std::int32_t> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_method3, channel_); method3(rpcOptions, std::move(callback)); return future; } folly::SemiFuture<::std::int32_t> service1AsyncClient::semifuture_method3(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_method3, channel_); auto callback = std::move(callbackAndFuture.first); method3(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } folly::Future>> service1AsyncClient::header_future_method3(apache::thrift::RpcOptions& rpcOptions) { folly::Promise>> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_method3, channel_); method3(rpcOptions, std::move(callback)); return future; } folly::SemiFuture>> service1AsyncClient::header_semifuture_method3(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_method3, channel_); auto callback = std::move(callbackAndFuture.first); method3(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } void service1AsyncClient::method3(folly::Function callback) { method3(std::make_unique(std::move(callback))); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper service1AsyncClient::recv_wrapped_method3(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } if (!state.hasResponseBuffer()) { return folly::make_exception_wrapper("recv_ called without result"); } using result = service1_method3_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } ::std::int32_t service1AsyncClient::recv_method3(::apache::thrift::ClientReceiveState& state) { ::std::int32_t _return; auto ew = recv_wrapped_method3(_return, state); if (ew) { ew.throw_exception(); } return _return; } ::std::int32_t service1AsyncClient::recv_instance_method3(::apache::thrift::ClientReceiveState& state) { return recv_method3(state); } folly::exception_wrapper service1AsyncClient::recv_instance_wrapped_method3(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_method3(_return, state); } void service1AsyncClient::method4(std::unique_ptr callback, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { ::apache::thrift::RpcOptions rpcOptions; method4(rpcOptions, std::move(callback), p_i, p_j, p_k); } void service1AsyncClient::method4(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { auto [ctx, header] = method4Ctx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)); method4Impl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback), p_i, p_j, p_k); } void service1AsyncClient::method4Impl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { method4T(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_i, p_j, p_k); } else { method4T(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_i, p_j, p_k); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { method4T(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_i, p_j, p_k); } else { method4T(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_i, p_j, p_k); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair, std::shared_ptr<::apache::thrift::transport::THeader>> service1AsyncClient::method4Ctx(apache::thrift::RpcOptions* rpcOptions) { auto header = std::make_shared( apache::thrift::transport::THeader::ALLOW_BIG_FRAMES); header->setProtocolId(channel_->getProtocolId()); if (rpcOptions) { header->setHeaders(rpcOptions->releaseWriteHeaders()); } auto ctx = apache::thrift::ContextStack::createWithClientContext( handlers_, getServiceName(), "service1.method4", *header); return {std::move(ctx), std::move(header)}; } ::std::int32_t service1AsyncClient::sync_method4(::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { ::apache::thrift::RpcOptions rpcOptions; return sync_method4(rpcOptions, p_i, p_j, p_k); } ::std::int32_t service1AsyncClient::sync_method4(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = method4Ctx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); callback.waitUntilDone( evb, [&] { method4Impl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback), p_i, p_j, p_k); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { return recv_method4(returnState); }); } folly::Future<::std::int32_t> service1AsyncClient::future_method4(::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { ::apache::thrift::RpcOptions rpcOptions; return future_method4(rpcOptions, p_i, p_j, p_k); } folly::SemiFuture<::std::int32_t> service1AsyncClient::semifuture_method4(::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { ::apache::thrift::RpcOptions rpcOptions; return semifuture_method4(rpcOptions, p_i, p_j, p_k); } folly::Future<::std::int32_t> service1AsyncClient::future_method4(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { folly::Promise<::std::int32_t> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_method4, channel_); method4(rpcOptions, std::move(callback), p_i, p_j, p_k); return future; } folly::SemiFuture<::std::int32_t> service1AsyncClient::semifuture_method4(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_method4, channel_); auto callback = std::move(callbackAndFuture.first); method4(rpcOptions, std::move(callback), p_i, p_j, p_k); return std::move(callbackAndFuture.second); } folly::Future>> service1AsyncClient::header_future_method4(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { folly::Promise>> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_method4, channel_); method4(rpcOptions, std::move(callback), p_i, p_j, p_k); return future; } folly::SemiFuture>> service1AsyncClient::header_semifuture_method4(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_method4, channel_); auto callback = std::move(callbackAndFuture.first); method4(rpcOptions, std::move(callback), p_i, p_j, p_k); return std::move(callbackAndFuture.second); } void service1AsyncClient::method4(folly::Function callback, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { method4(std::make_unique(std::move(callback)), p_i, p_j, p_k); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper service1AsyncClient::recv_wrapped_method4(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } if (!state.hasResponseBuffer()) { return folly::make_exception_wrapper("recv_ called without result"); } using result = service1_method4_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } ::std::int32_t service1AsyncClient::recv_method4(::apache::thrift::ClientReceiveState& state) { ::std::int32_t _return; auto ew = recv_wrapped_method4(_return, state); if (ew) { ew.throw_exception(); } return _return; } ::std::int32_t service1AsyncClient::recv_instance_method4(::apache::thrift::ClientReceiveState& state) { return recv_method4(state); } folly::exception_wrapper service1AsyncClient::recv_instance_wrapped_method4(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_method4(_return, state); } void service1AsyncClient::method5(std::unique_ptr callback) { ::apache::thrift::RpcOptions rpcOptions; method5(rpcOptions, std::move(callback)); } void service1AsyncClient::method5(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback) { auto [ctx, header] = method5Ctx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)); method5Impl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback)); } void service1AsyncClient::method5Impl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { method5T(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback)); } else { method5T(&writer, rpcOptions, std::move(header), contextStack, std::move(callback)); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { method5T(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback)); } else { method5T(&writer, rpcOptions, std::move(header), contextStack, std::move(callback)); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair, std::shared_ptr<::apache::thrift::transport::THeader>> service1AsyncClient::method5Ctx(apache::thrift::RpcOptions* rpcOptions) { auto header = std::make_shared( apache::thrift::transport::THeader::ALLOW_BIG_FRAMES); header->setProtocolId(channel_->getProtocolId()); if (rpcOptions) { header->setHeaders(rpcOptions->releaseWriteHeaders()); } auto ctx = apache::thrift::ContextStack::createWithClientContext( handlers_, getServiceName(), "service1.method5", *header); return {std::move(ctx), std::move(header)}; } void service1AsyncClient::sync_method5(::test_cpp2::cpp_reflection::struct2& _return) { ::apache::thrift::RpcOptions rpcOptions; sync_method5(rpcOptions, _return); } void service1AsyncClient::sync_method5(apache::thrift::RpcOptions& rpcOptions, ::test_cpp2::cpp_reflection::struct2& _return) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = method5Ctx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); callback.waitUntilDone( evb, [&] { method5Impl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback)); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { recv_method5(_return, returnState); }); } folly::Future<::test_cpp2::cpp_reflection::struct2> service1AsyncClient::future_method5() { ::apache::thrift::RpcOptions rpcOptions; return future_method5(rpcOptions); } folly::SemiFuture<::test_cpp2::cpp_reflection::struct2> service1AsyncClient::semifuture_method5() { ::apache::thrift::RpcOptions rpcOptions; return semifuture_method5(rpcOptions); } folly::Future<::test_cpp2::cpp_reflection::struct2> service1AsyncClient::future_method5(apache::thrift::RpcOptions& rpcOptions) { folly::Promise<::test_cpp2::cpp_reflection::struct2> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_method5, channel_); method5(rpcOptions, std::move(callback)); return future; } folly::SemiFuture<::test_cpp2::cpp_reflection::struct2> service1AsyncClient::semifuture_method5(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_method5, channel_); auto callback = std::move(callbackAndFuture.first); method5(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } folly::Future>> service1AsyncClient::header_future_method5(apache::thrift::RpcOptions& rpcOptions) { folly::Promise>> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_method5, channel_); method5(rpcOptions, std::move(callback)); return future; } folly::SemiFuture>> service1AsyncClient::header_semifuture_method5(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_method5, channel_); auto callback = std::move(callbackAndFuture.first); method5(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } void service1AsyncClient::method5(folly::Function callback) { method5(std::make_unique(std::move(callback))); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper service1AsyncClient::recv_wrapped_method5(::test_cpp2::cpp_reflection::struct2& _return, ::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } if (!state.hasResponseBuffer()) { return folly::make_exception_wrapper("recv_ called without result"); } using result = service1_method5_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } void service1AsyncClient::recv_method5(::test_cpp2::cpp_reflection::struct2& _return, ::apache::thrift::ClientReceiveState& state) { auto ew = recv_wrapped_method5(_return, state); if (ew) { ew.throw_exception(); } } void service1AsyncClient::recv_instance_method5(::test_cpp2::cpp_reflection::struct2& _return, ::apache::thrift::ClientReceiveState& state) { return recv_method5(_return, state); } folly::exception_wrapper service1AsyncClient::recv_instance_wrapped_method5(::test_cpp2::cpp_reflection::struct2& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_method5(_return, state); } void service1AsyncClient::method6(std::unique_ptr callback, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { ::apache::thrift::RpcOptions rpcOptions; method6(rpcOptions, std::move(callback), p_l, p_m, p_n); } void service1AsyncClient::method6(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { auto [ctx, header] = method6Ctx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)); method6Impl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback), p_l, p_m, p_n); } void service1AsyncClient::method6Impl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { method6T(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_l, p_m, p_n); } else { method6T(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_l, p_m, p_n); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { method6T(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_l, p_m, p_n); } else { method6T(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_l, p_m, p_n); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair, std::shared_ptr<::apache::thrift::transport::THeader>> service1AsyncClient::method6Ctx(apache::thrift::RpcOptions* rpcOptions) { auto header = std::make_shared( apache::thrift::transport::THeader::ALLOW_BIG_FRAMES); header->setProtocolId(channel_->getProtocolId()); if (rpcOptions) { header->setHeaders(rpcOptions->releaseWriteHeaders()); } auto ctx = apache::thrift::ContextStack::createWithClientContext( handlers_, getServiceName(), "service1.method6", *header); return {std::move(ctx), std::move(header)}; } void service1AsyncClient::sync_method6(::test_cpp2::cpp_reflection::struct2& _return, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { ::apache::thrift::RpcOptions rpcOptions; sync_method6(rpcOptions, _return, p_l, p_m, p_n); } void service1AsyncClient::sync_method6(apache::thrift::RpcOptions& rpcOptions, ::test_cpp2::cpp_reflection::struct2& _return, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = method6Ctx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); callback.waitUntilDone( evb, [&] { method6Impl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback), p_l, p_m, p_n); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { recv_method6(_return, returnState); }); } folly::Future<::test_cpp2::cpp_reflection::struct2> service1AsyncClient::future_method6(::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { ::apache::thrift::RpcOptions rpcOptions; return future_method6(rpcOptions, p_l, p_m, p_n); } folly::SemiFuture<::test_cpp2::cpp_reflection::struct2> service1AsyncClient::semifuture_method6(::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { ::apache::thrift::RpcOptions rpcOptions; return semifuture_method6(rpcOptions, p_l, p_m, p_n); } folly::Future<::test_cpp2::cpp_reflection::struct2> service1AsyncClient::future_method6(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { folly::Promise<::test_cpp2::cpp_reflection::struct2> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_method6, channel_); method6(rpcOptions, std::move(callback), p_l, p_m, p_n); return future; } folly::SemiFuture<::test_cpp2::cpp_reflection::struct2> service1AsyncClient::semifuture_method6(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_method6, channel_); auto callback = std::move(callbackAndFuture.first); method6(rpcOptions, std::move(callback), p_l, p_m, p_n); return std::move(callbackAndFuture.second); } folly::Future>> service1AsyncClient::header_future_method6(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { folly::Promise>> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_method6, channel_); method6(rpcOptions, std::move(callback), p_l, p_m, p_n); return future; } folly::SemiFuture>> service1AsyncClient::header_semifuture_method6(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_method6, channel_); auto callback = std::move(callbackAndFuture.first); method6(rpcOptions, std::move(callback), p_l, p_m, p_n); return std::move(callbackAndFuture.second); } void service1AsyncClient::method6(folly::Function callback, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { method6(std::make_unique(std::move(callback)), p_l, p_m, p_n); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper service1AsyncClient::recv_wrapped_method6(::test_cpp2::cpp_reflection::struct2& _return, ::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } if (!state.hasResponseBuffer()) { return folly::make_exception_wrapper("recv_ called without result"); } using result = service1_method6_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } void service1AsyncClient::recv_method6(::test_cpp2::cpp_reflection::struct2& _return, ::apache::thrift::ClientReceiveState& state) { auto ew = recv_wrapped_method6(_return, state); if (ew) { ew.throw_exception(); } } void service1AsyncClient::recv_instance_method6(::test_cpp2::cpp_reflection::struct2& _return, ::apache::thrift::ClientReceiveState& state) { return recv_method6(_return, state); } folly::exception_wrapper service1AsyncClient::recv_instance_wrapped_method6(::test_cpp2::cpp_reflection::struct2& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_method6(_return, state); } }} // test_cpp2::cpp_reflection