/** * Autogenerated by Thrift for thrift/compiler/test/fixtures/py3/src/module.thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @nocommit */ #pragma once #include "thrift/compiler/test/fixtures/py3/gen-py3cpp/SimpleService.h" #include namespace py3::simple { typedef apache::thrift::ThriftPresult SimpleService_get_five_pargs; typedef apache::thrift::ThriftPresult> SimpleService_get_five_presult; typedef apache::thrift::ThriftPresult> SimpleService_add_five_pargs; typedef apache::thrift::ThriftPresult> SimpleService_add_five_presult; typedef apache::thrift::ThriftPresult SimpleService_do_nothing_pargs; typedef apache::thrift::ThriftPresult SimpleService_do_nothing_presult; typedef apache::thrift::ThriftPresult, apache::thrift::FieldData<2, ::apache::thrift::type_class::string, ::std::string*>> SimpleService_concat_pargs; typedef apache::thrift::ThriftPresult> SimpleService_concat_presult; typedef apache::thrift::ThriftPresult> SimpleService_get_value_pargs; typedef apache::thrift::ThriftPresult> SimpleService_get_value_presult; typedef apache::thrift::ThriftPresult> SimpleService_negate_pargs; typedef apache::thrift::ThriftPresult> SimpleService_negate_presult; typedef apache::thrift::ThriftPresult> SimpleService_tiny_pargs; typedef apache::thrift::ThriftPresult> SimpleService_tiny_presult; typedef apache::thrift::ThriftPresult> SimpleService_small_pargs; typedef apache::thrift::ThriftPresult> SimpleService_small_presult; typedef apache::thrift::ThriftPresult> SimpleService_big_pargs; typedef apache::thrift::ThriftPresult> SimpleService_big_presult; typedef apache::thrift::ThriftPresult> SimpleService_two_pargs; typedef apache::thrift::ThriftPresult> SimpleService_two_presult; typedef apache::thrift::ThriftPresult SimpleService_expected_exception_pargs; typedef apache::thrift::ThriftPresult> SimpleService_expected_exception_presult; typedef apache::thrift::ThriftPresult SimpleService_unexpected_exception_pargs; typedef apache::thrift::ThriftPresult> SimpleService_unexpected_exception_presult; typedef apache::thrift::ThriftPresult, ::std::vector<::std::int16_t>*>> SimpleService_sum_i16_list_pargs; typedef apache::thrift::ThriftPresult> SimpleService_sum_i16_list_presult; typedef apache::thrift::ThriftPresult, ::std::vector<::std::int32_t>*>> SimpleService_sum_i32_list_pargs; typedef apache::thrift::ThriftPresult> SimpleService_sum_i32_list_presult; typedef apache::thrift::ThriftPresult, ::std::vector<::std::int64_t>*>> SimpleService_sum_i64_list_pargs; typedef apache::thrift::ThriftPresult> SimpleService_sum_i64_list_presult; typedef apache::thrift::ThriftPresult, ::std::vector<::std::string>*>> SimpleService_concat_many_pargs; typedef apache::thrift::ThriftPresult> SimpleService_concat_many_presult; typedef apache::thrift::ThriftPresult, ::std::vector<::py3::simple::SimpleStruct>*>> SimpleService_count_structs_pargs; typedef apache::thrift::ThriftPresult> SimpleService_count_structs_presult; typedef apache::thrift::ThriftPresult, ::std::set<::std::int32_t>*>> SimpleService_sum_set_pargs; typedef apache::thrift::ThriftPresult> SimpleService_sum_set_presult; typedef apache::thrift::ThriftPresult, ::std::set<::std::string>*>, apache::thrift::FieldData<2, ::apache::thrift::type_class::string, ::std::string*>> SimpleService_contains_word_pargs; typedef apache::thrift::ThriftPresult> SimpleService_contains_word_presult; typedef apache::thrift::ThriftPresult, ::std::map<::std::string, ::std::string>*>, apache::thrift::FieldData<2, ::apache::thrift::type_class::string, ::std::string*>> SimpleService_get_map_value_pargs; typedef apache::thrift::ThriftPresult> SimpleService_get_map_value_presult; typedef apache::thrift::ThriftPresult, ::std::map<::std::string, ::py3::simple::SimpleStruct>*>> SimpleService_map_length_pargs; typedef apache::thrift::ThriftPresult> SimpleService_map_length_presult; typedef apache::thrift::ThriftPresult, ::std::map<::std::string, ::std::int16_t>*>> SimpleService_sum_map_values_pargs; typedef apache::thrift::ThriftPresult> SimpleService_sum_map_values_presult; typedef apache::thrift::ThriftPresult> SimpleService_complex_sum_i32_pargs; typedef apache::thrift::ThriftPresult> SimpleService_complex_sum_i32_presult; typedef apache::thrift::ThriftPresult> SimpleService_repeat_name_pargs; typedef apache::thrift::ThriftPresult> SimpleService_repeat_name_presult; typedef apache::thrift::ThriftPresult SimpleService_get_struct_pargs; typedef apache::thrift::ThriftPresult> SimpleService_get_struct_presult; typedef apache::thrift::ThriftPresult> SimpleService_fib_pargs; typedef apache::thrift::ThriftPresult, ::std::vector<::std::int32_t>*>> SimpleService_fib_presult; typedef apache::thrift::ThriftPresult, ::std::vector<::std::string>*>> SimpleService_unique_words_pargs; typedef apache::thrift::ThriftPresult, ::std::set<::std::string>*>> SimpleService_unique_words_presult; typedef apache::thrift::ThriftPresult, ::std::vector<::std::string>*>> SimpleService_words_count_pargs; typedef apache::thrift::ThriftPresult, ::std::map<::std::string, ::std::int16_t>*>> SimpleService_words_count_presult; typedef apache::thrift::ThriftPresult> SimpleService_set_enum_pargs; typedef apache::thrift::ThriftPresult> SimpleService_set_enum_presult; typedef apache::thrift::ThriftPresult, apache::thrift::FieldData<2, ::apache::thrift::type_class::integral, ::std::int16_t*>> SimpleService_list_of_lists_pargs; typedef apache::thrift::ThriftPresult>, ::std::vector<::std::vector<::std::int32_t>>*>> SimpleService_list_of_lists_presult; typedef apache::thrift::ThriftPresult> SimpleService_word_character_frequency_pargs; typedef apache::thrift::ThriftPresult>, ::std::map<::std::string, ::std::map<::std::string, ::std::int32_t>>*>> SimpleService_word_character_frequency_presult; typedef apache::thrift::ThriftPresult> SimpleService_list_of_sets_pargs; typedef apache::thrift::ThriftPresult>, ::std::vector<::std::set<::std::string>>*>> SimpleService_list_of_sets_presult; typedef apache::thrift::ThriftPresult>, ::std::map<::std::string, ::std::vector<::py3::simple::SimpleStruct>>*>> SimpleService_nested_map_argument_pargs; typedef apache::thrift::ThriftPresult> SimpleService_nested_map_argument_presult; typedef apache::thrift::ThriftPresult>, ::std::vector<::std::vector<::std::string>>*>> SimpleService_make_sentence_pargs; typedef apache::thrift::ThriftPresult> SimpleService_make_sentence_presult; typedef apache::thrift::ThriftPresult>, ::std::vector<::std::set<::std::int32_t>>*>> SimpleService_get_union_pargs; typedef apache::thrift::ThriftPresult, ::std::set<::std::int32_t>*>> SimpleService_get_union_presult; typedef apache::thrift::ThriftPresult>, ::std::vector<::std::map<::std::string, ::std::string>>*>> SimpleService_get_keys_pargs; typedef apache::thrift::ThriftPresult, ::std::set<::std::string>*>> SimpleService_get_keys_presult; typedef apache::thrift::ThriftPresult> SimpleService_lookup_double_pargs; typedef apache::thrift::ThriftPresult> SimpleService_lookup_double_presult; typedef apache::thrift::ThriftPresult> SimpleService_retrieve_binary_pargs; typedef apache::thrift::ThriftPresult> SimpleService_retrieve_binary_presult; typedef apache::thrift::ThriftPresult, ::std::vector<::std::string>*>> SimpleService_contain_binary_pargs; typedef apache::thrift::ThriftPresult, ::std::set<::std::string>*>> SimpleService_contain_binary_presult; typedef apache::thrift::ThriftPresult, ::std::vector<::py3::simple::AnEnum>*>> SimpleService_contain_enum_pargs; typedef apache::thrift::ThriftPresult, ::std::vector<::py3::simple::AnEnum>*>> SimpleService_contain_enum_presult; typedef apache::thrift::ThriftPresult> SimpleService_get_binary_union_struct_pargs; typedef apache::thrift::ThriftPresult> SimpleService_get_binary_union_struct_presult; typedef apache::thrift::ThriftPresult SimpleService_get_struct_hidden_pargs; typedef apache::thrift::ThriftPresult> SimpleService_get_struct_hidden_presult; template void SimpleServiceAsyncProcessor::setUpAndProcess_get_five(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_get_five, this); } template void SimpleServiceAsyncProcessor::executeRequest_get_five(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { SimpleService_get_five_pargs pargs() { SimpleService_get_five_pargs args; return args; } auto asTupleOfRefs() & { return std::tie( ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.get_five", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "get_five", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "get_five"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr<::std::int32_t>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "get_five" , return_get_five , throw_wrapped_get_five , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_get_five(std::move(cb)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_get_five(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_get_five_presult result; result.get<0>().value = const_cast<::std::int32_t*>(&_return); result.setIsSet(0, true); return serializeResponse("get_five", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_get_five(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "get_five"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_add_five(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_add_five, this); } template void SimpleServiceAsyncProcessor::executeRequest_add_five(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { ::std::int32_t uarg_num{0}; SimpleService_add_five_pargs pargs() { SimpleService_add_five_pargs args; args.get<0>().value = &uarg_num; return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(uarg_num) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.add_five", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "add_five", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "add_five"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr<::std::int32_t>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "add_five" , return_add_five , throw_wrapped_add_five , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_add_five(std::move(cb), args.uarg_num); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_add_five(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_add_five_presult result; result.get<0>().value = const_cast<::std::int32_t*>(&_return); result.setIsSet(0, true); return serializeResponse("add_five", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_add_five(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "add_five"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_do_nothing(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_do_nothing, this); } template void SimpleServiceAsyncProcessor::executeRequest_do_nothing(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { SimpleService_do_nothing_pargs pargs() { SimpleService_do_nothing_pargs args; return args; } auto asTupleOfRefs() & { return std::tie( ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.do_nothing", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "do_nothing", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "do_nothing"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "do_nothing" , return_do_nothing , throw_wrapped_do_nothing , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_do_nothing(std::move(cb)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_do_nothing(apache::thrift::ContextStack* ctx) { ProtocolOut_ prot; ::py3::simple::SimpleService_do_nothing_presult result; return serializeResponse("do_nothing", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_do_nothing(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "do_nothing"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_concat(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_concat, this); } template void SimpleServiceAsyncProcessor::executeRequest_concat(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::string> uarg_first = std::make_unique<::std::string>(); std::unique_ptr<::std::string> uarg_second = std::make_unique<::std::string>(); SimpleService_concat_pargs pargs() { SimpleService_concat_pargs args; args.get<0>().value = uarg_first.get(); args.get<1>().value = uarg_second.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_first), std::as_const(*uarg_second) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.concat", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "concat", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "concat"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "concat" , return_concat , throw_wrapped_concat , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_concat(std::move(cb), std::move(args.uarg_first), std::move(args.uarg_second)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_concat(apache::thrift::ContextStack* ctx, ::std::string const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_concat_presult result; result.get<0>().value = const_cast<::std::string*>(&_return); result.setIsSet(0, true); return serializeResponse("concat", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_concat(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "concat"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_get_value(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_get_value, this); } template void SimpleServiceAsyncProcessor::executeRequest_get_value(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::py3::simple::SimpleStruct> uarg_simple_struct = std::make_unique<::py3::simple::SimpleStruct>(); SimpleService_get_value_pargs pargs() { SimpleService_get_value_pargs args; args.get<0>().value = uarg_simple_struct.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_simple_struct) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.get_value", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "get_value", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "get_value"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr<::std::int32_t>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "get_value" , return_get_value , throw_wrapped_get_value , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_get_value(std::move(cb), std::move(args.uarg_simple_struct)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_get_value(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_get_value_presult result; result.get<0>().value = const_cast<::std::int32_t*>(&_return); result.setIsSet(0, true); return serializeResponse("get_value", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_get_value(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "get_value"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_negate(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_negate, this); } template void SimpleServiceAsyncProcessor::executeRequest_negate(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { bool uarg_input{0}; SimpleService_negate_pargs pargs() { SimpleService_negate_pargs args; args.get<0>().value = &uarg_input; return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(uarg_input) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.negate", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "negate", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "negate"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "negate" , return_negate , throw_wrapped_negate , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_negate(std::move(cb), args.uarg_input); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_negate(apache::thrift::ContextStack* ctx, bool const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_negate_presult result; result.get<0>().value = const_cast(&_return); result.setIsSet(0, true); return serializeResponse("negate", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_negate(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "negate"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_tiny(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_tiny, this); } template void SimpleServiceAsyncProcessor::executeRequest_tiny(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { ::std::int8_t uarg_input{0}; SimpleService_tiny_pargs pargs() { SimpleService_tiny_pargs args; args.get<0>().value = &uarg_input; return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(uarg_input) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.tiny", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "tiny", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "tiny"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr<::std::int8_t>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "tiny" , return_tiny , throw_wrapped_tiny , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_tiny(std::move(cb), args.uarg_input); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_tiny(apache::thrift::ContextStack* ctx, ::std::int8_t const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_tiny_presult result; result.get<0>().value = const_cast<::std::int8_t*>(&_return); result.setIsSet(0, true); return serializeResponse("tiny", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_tiny(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "tiny"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_small(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_small, this); } template void SimpleServiceAsyncProcessor::executeRequest_small(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { ::std::int16_t uarg_input{0}; SimpleService_small_pargs pargs() { SimpleService_small_pargs args; args.get<0>().value = &uarg_input; return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(uarg_input) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.small", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "small", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "small"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr<::std::int16_t>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "small" , return_small , throw_wrapped_small , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_small(std::move(cb), args.uarg_input); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_small(apache::thrift::ContextStack* ctx, ::std::int16_t const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_small_presult result; result.get<0>().value = const_cast<::std::int16_t*>(&_return); result.setIsSet(0, true); return serializeResponse("small", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_small(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "small"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_big(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_big, this); } template void SimpleServiceAsyncProcessor::executeRequest_big(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { ::std::int64_t uarg_input{0}; SimpleService_big_pargs pargs() { SimpleService_big_pargs args; args.get<0>().value = &uarg_input; return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(uarg_input) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.big", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "big", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "big"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr<::std::int64_t>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "big" , return_big , throw_wrapped_big , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_big(std::move(cb), args.uarg_input); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_big(apache::thrift::ContextStack* ctx, ::std::int64_t const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_big_presult result; result.get<0>().value = const_cast<::std::int64_t*>(&_return); result.setIsSet(0, true); return serializeResponse("big", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_big(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "big"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_two(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_two, this); } template void SimpleServiceAsyncProcessor::executeRequest_two(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { double uarg_input{0}; SimpleService_two_pargs pargs() { SimpleService_two_pargs args; args.get<0>().value = &uarg_input; return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(uarg_input) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.two", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "two", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "two"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "two" , return_two , throw_wrapped_two , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_two(std::move(cb), args.uarg_input); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_two(apache::thrift::ContextStack* ctx, double const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_two_presult result; result.get<0>().value = const_cast(&_return); result.setIsSet(0, true); return serializeResponse("two", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_two(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "two"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_expected_exception(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_expected_exception, this); } template void SimpleServiceAsyncProcessor::executeRequest_expected_exception(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { SimpleService_expected_exception_pargs pargs() { SimpleService_expected_exception_pargs args; return args; } auto asTupleOfRefs() & { return std::tie( ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.expected_exception", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "expected_exception", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "expected_exception"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "expected_exception" , return_expected_exception , throw_wrapped_expected_exception , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_expected_exception(std::move(cb)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_expected_exception(apache::thrift::ContextStack* ctx) { ProtocolOut_ prot; ::py3::simple::SimpleService_expected_exception_presult result; return serializeResponse("expected_exception", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_expected_exception(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } ::py3::simple::SimpleService_expected_exception_presult result; if (ew.with_exception([&]( ::py3::simple::SimpleException& e) { if (ctx) { ctx->userExceptionWrapped(true, ew); } ::apache::thrift::util::appendExceptionToHeader(ew, *reqCtx); ::apache::thrift::util::appendErrorClassificationToHeader< ::py3::simple::SimpleException>(ew, *reqCtx); result.get<0>().ref() = e; result.setIsSet(0, true); } )) {} else { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "expected_exception"); return; } ProtocolOut_ prot; auto response = serializeResponse("expected_exception", &prot, ctx, result); auto payload = std::move(response).extractPayload( req->includeEnvelope(), prot.protocolType(), protoSeqId, apache::thrift::MessageType::T_REPLY, "expected_exception"); payload.transform(reqCtx->getHeader()->getWriteTransforms()); return req->sendReply(std::move(payload)); } template void SimpleServiceAsyncProcessor::setUpAndProcess_unexpected_exception(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_unexpected_exception, this); } template void SimpleServiceAsyncProcessor::executeRequest_unexpected_exception(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { SimpleService_unexpected_exception_pargs pargs() { SimpleService_unexpected_exception_pargs args; return args; } auto asTupleOfRefs() & { return std::tie( ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.unexpected_exception", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "unexpected_exception", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "unexpected_exception"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr<::std::int32_t>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "unexpected_exception" , return_unexpected_exception , throw_wrapped_unexpected_exception , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_unexpected_exception(std::move(cb)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_unexpected_exception(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_unexpected_exception_presult result; result.get<0>().value = const_cast<::std::int32_t*>(&_return); result.setIsSet(0, true); return serializeResponse("unexpected_exception", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_unexpected_exception(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "unexpected_exception"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_sum_i16_list(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_sum_i16_list, this); } template void SimpleServiceAsyncProcessor::executeRequest_sum_i16_list(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::vector<::std::int16_t>> uarg_numbers = std::make_unique<::std::vector<::std::int16_t>>(); SimpleService_sum_i16_list_pargs pargs() { SimpleService_sum_i16_list_pargs args; args.get<0>().value = uarg_numbers.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_numbers) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.sum_i16_list", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "sum_i16_list", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "sum_i16_list"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr<::std::int32_t>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "sum_i16_list" , return_sum_i16_list , throw_wrapped_sum_i16_list , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_sum_i16_list(std::move(cb), std::move(args.uarg_numbers)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_sum_i16_list(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_sum_i16_list_presult result; result.get<0>().value = const_cast<::std::int32_t*>(&_return); result.setIsSet(0, true); return serializeResponse("sum_i16_list", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_sum_i16_list(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "sum_i16_list"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_sum_i32_list(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_sum_i32_list, this); } template void SimpleServiceAsyncProcessor::executeRequest_sum_i32_list(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::vector<::std::int32_t>> uarg_numbers = std::make_unique<::std::vector<::std::int32_t>>(); SimpleService_sum_i32_list_pargs pargs() { SimpleService_sum_i32_list_pargs args; args.get<0>().value = uarg_numbers.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_numbers) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.sum_i32_list", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "sum_i32_list", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "sum_i32_list"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr<::std::int32_t>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "sum_i32_list" , return_sum_i32_list , throw_wrapped_sum_i32_list , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_sum_i32_list(std::move(cb), std::move(args.uarg_numbers)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_sum_i32_list(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_sum_i32_list_presult result; result.get<0>().value = const_cast<::std::int32_t*>(&_return); result.setIsSet(0, true); return serializeResponse("sum_i32_list", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_sum_i32_list(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "sum_i32_list"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_sum_i64_list(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_sum_i64_list, this); } template void SimpleServiceAsyncProcessor::executeRequest_sum_i64_list(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::vector<::std::int64_t>> uarg_numbers = std::make_unique<::std::vector<::std::int64_t>>(); SimpleService_sum_i64_list_pargs pargs() { SimpleService_sum_i64_list_pargs args; args.get<0>().value = uarg_numbers.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_numbers) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.sum_i64_list", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "sum_i64_list", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "sum_i64_list"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr<::std::int32_t>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "sum_i64_list" , return_sum_i64_list , throw_wrapped_sum_i64_list , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_sum_i64_list(std::move(cb), std::move(args.uarg_numbers)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_sum_i64_list(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_sum_i64_list_presult result; result.get<0>().value = const_cast<::std::int32_t*>(&_return); result.setIsSet(0, true); return serializeResponse("sum_i64_list", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_sum_i64_list(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "sum_i64_list"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_concat_many(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_concat_many, this); } template void SimpleServiceAsyncProcessor::executeRequest_concat_many(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::vector<::std::string>> uarg_words = std::make_unique<::std::vector<::std::string>>(); SimpleService_concat_many_pargs pargs() { SimpleService_concat_many_pargs args; args.get<0>().value = uarg_words.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_words) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.concat_many", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "concat_many", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "concat_many"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "concat_many" , return_concat_many , throw_wrapped_concat_many , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_concat_many(std::move(cb), std::move(args.uarg_words)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_concat_many(apache::thrift::ContextStack* ctx, ::std::string const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_concat_many_presult result; result.get<0>().value = const_cast<::std::string*>(&_return); result.setIsSet(0, true); return serializeResponse("concat_many", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_concat_many(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "concat_many"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_count_structs(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_count_structs, this); } template void SimpleServiceAsyncProcessor::executeRequest_count_structs(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::vector<::py3::simple::SimpleStruct>> uarg_items = std::make_unique<::std::vector<::py3::simple::SimpleStruct>>(); SimpleService_count_structs_pargs pargs() { SimpleService_count_structs_pargs args; args.get<0>().value = uarg_items.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_items) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.count_structs", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "count_structs", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "count_structs"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr<::std::int32_t>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "count_structs" , return_count_structs , throw_wrapped_count_structs , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_count_structs(std::move(cb), std::move(args.uarg_items)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_count_structs(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_count_structs_presult result; result.get<0>().value = const_cast<::std::int32_t*>(&_return); result.setIsSet(0, true); return serializeResponse("count_structs", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_count_structs(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "count_structs"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_sum_set(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_sum_set, this); } template void SimpleServiceAsyncProcessor::executeRequest_sum_set(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::set<::std::int32_t>> uarg_numbers = std::make_unique<::std::set<::std::int32_t>>(); SimpleService_sum_set_pargs pargs() { SimpleService_sum_set_pargs args; args.get<0>().value = uarg_numbers.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_numbers) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.sum_set", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "sum_set", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "sum_set"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr<::std::int32_t>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "sum_set" , return_sum_set , throw_wrapped_sum_set , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_sum_set(std::move(cb), std::move(args.uarg_numbers)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_sum_set(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_sum_set_presult result; result.get<0>().value = const_cast<::std::int32_t*>(&_return); result.setIsSet(0, true); return serializeResponse("sum_set", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_sum_set(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "sum_set"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_contains_word(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_contains_word, this); } template void SimpleServiceAsyncProcessor::executeRequest_contains_word(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::set<::std::string>> uarg_words = std::make_unique<::std::set<::std::string>>(); std::unique_ptr<::std::string> uarg_word = std::make_unique<::std::string>(); SimpleService_contains_word_pargs pargs() { SimpleService_contains_word_pargs args; args.get<0>().value = uarg_words.get(); args.get<1>().value = uarg_word.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_words), std::as_const(*uarg_word) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.contains_word", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "contains_word", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "contains_word"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "contains_word" , return_contains_word , throw_wrapped_contains_word , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_contains_word(std::move(cb), std::move(args.uarg_words), std::move(args.uarg_word)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_contains_word(apache::thrift::ContextStack* ctx, bool const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_contains_word_presult result; result.get<0>().value = const_cast(&_return); result.setIsSet(0, true); return serializeResponse("contains_word", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_contains_word(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "contains_word"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_get_map_value(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_get_map_value, this); } template void SimpleServiceAsyncProcessor::executeRequest_get_map_value(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::map<::std::string, ::std::string>> uarg_words = std::make_unique<::std::map<::std::string, ::std::string>>(); std::unique_ptr<::std::string> uarg_key = std::make_unique<::std::string>(); SimpleService_get_map_value_pargs pargs() { SimpleService_get_map_value_pargs args; args.get<0>().value = uarg_words.get(); args.get<1>().value = uarg_key.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_words), std::as_const(*uarg_key) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.get_map_value", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "get_map_value", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "get_map_value"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "get_map_value" , return_get_map_value , throw_wrapped_get_map_value , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_get_map_value(std::move(cb), std::move(args.uarg_words), std::move(args.uarg_key)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_get_map_value(apache::thrift::ContextStack* ctx, ::std::string const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_get_map_value_presult result; result.get<0>().value = const_cast<::std::string*>(&_return); result.setIsSet(0, true); return serializeResponse("get_map_value", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_get_map_value(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "get_map_value"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_map_length(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_map_length, this); } template void SimpleServiceAsyncProcessor::executeRequest_map_length(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::map<::std::string, ::py3::simple::SimpleStruct>> uarg_items = std::make_unique<::std::map<::std::string, ::py3::simple::SimpleStruct>>(); SimpleService_map_length_pargs pargs() { SimpleService_map_length_pargs args; args.get<0>().value = uarg_items.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_items) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.map_length", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "map_length", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "map_length"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr<::std::int16_t>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "map_length" , return_map_length , throw_wrapped_map_length , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_map_length(std::move(cb), std::move(args.uarg_items)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_map_length(apache::thrift::ContextStack* ctx, ::std::int16_t const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_map_length_presult result; result.get<0>().value = const_cast<::std::int16_t*>(&_return); result.setIsSet(0, true); return serializeResponse("map_length", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_map_length(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "map_length"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_sum_map_values(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_sum_map_values, this); } template void SimpleServiceAsyncProcessor::executeRequest_sum_map_values(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::map<::std::string, ::std::int16_t>> uarg_items = std::make_unique<::std::map<::std::string, ::std::int16_t>>(); SimpleService_sum_map_values_pargs pargs() { SimpleService_sum_map_values_pargs args; args.get<0>().value = uarg_items.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_items) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.sum_map_values", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "sum_map_values", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "sum_map_values"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr<::std::int16_t>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "sum_map_values" , return_sum_map_values , throw_wrapped_sum_map_values , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_sum_map_values(std::move(cb), std::move(args.uarg_items)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_sum_map_values(apache::thrift::ContextStack* ctx, ::std::int16_t const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_sum_map_values_presult result; result.get<0>().value = const_cast<::std::int16_t*>(&_return); result.setIsSet(0, true); return serializeResponse("sum_map_values", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_sum_map_values(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "sum_map_values"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_complex_sum_i32(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_complex_sum_i32, this); } template void SimpleServiceAsyncProcessor::executeRequest_complex_sum_i32(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::py3::simple::ComplexStruct> uarg_counter = std::make_unique<::py3::simple::ComplexStruct>(); SimpleService_complex_sum_i32_pargs pargs() { SimpleService_complex_sum_i32_pargs args; args.get<0>().value = uarg_counter.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_counter) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.complex_sum_i32", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "complex_sum_i32", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "complex_sum_i32"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr<::std::int32_t>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "complex_sum_i32" , return_complex_sum_i32 , throw_wrapped_complex_sum_i32 , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_complex_sum_i32(std::move(cb), std::move(args.uarg_counter)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_complex_sum_i32(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_complex_sum_i32_presult result; result.get<0>().value = const_cast<::std::int32_t*>(&_return); result.setIsSet(0, true); return serializeResponse("complex_sum_i32", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_complex_sum_i32(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "complex_sum_i32"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_repeat_name(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_repeat_name, this); } template void SimpleServiceAsyncProcessor::executeRequest_repeat_name(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::py3::simple::ComplexStruct> uarg_counter = std::make_unique<::py3::simple::ComplexStruct>(); SimpleService_repeat_name_pargs pargs() { SimpleService_repeat_name_pargs args; args.get<0>().value = uarg_counter.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_counter) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.repeat_name", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "repeat_name", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "repeat_name"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "repeat_name" , return_repeat_name , throw_wrapped_repeat_name , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_repeat_name(std::move(cb), std::move(args.uarg_counter)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_repeat_name(apache::thrift::ContextStack* ctx, ::std::string const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_repeat_name_presult result; result.get<0>().value = const_cast<::std::string*>(&_return); result.setIsSet(0, true); return serializeResponse("repeat_name", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_repeat_name(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "repeat_name"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_get_struct(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_get_struct, this); } template void SimpleServiceAsyncProcessor::executeRequest_get_struct(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { SimpleService_get_struct_pargs pargs() { SimpleService_get_struct_pargs args; return args; } auto asTupleOfRefs() & { return std::tie( ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.get_struct", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "get_struct", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "get_struct"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "get_struct" , return_get_struct , throw_wrapped_get_struct , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_get_struct(std::move(cb)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_get_struct(apache::thrift::ContextStack* ctx, ::py3::simple::SimpleStruct const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_get_struct_presult result; result.get<0>().value = const_cast<::py3::simple::SimpleStruct*>(&_return); result.setIsSet(0, true); return serializeResponse("get_struct", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_get_struct(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "get_struct"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_fib(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_fib, this); } template void SimpleServiceAsyncProcessor::executeRequest_fib(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { ::std::int16_t uarg_n{0}; SimpleService_fib_pargs pargs() { SimpleService_fib_pargs args; args.get<0>().value = &uarg_n; return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(uarg_n) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.fib", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "fib", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "fib"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr>>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "fib" , return_fib , throw_wrapped_fib , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_fib(std::move(cb), args.uarg_n); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_fib(apache::thrift::ContextStack* ctx, ::std::vector<::std::int32_t> const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_fib_presult result; result.get<0>().value = const_cast<::std::vector<::std::int32_t>*>(&_return); result.setIsSet(0, true); return serializeResponse("fib", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_fib(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "fib"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_unique_words(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_unique_words, this); } template void SimpleServiceAsyncProcessor::executeRequest_unique_words(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::vector<::std::string>> uarg_words = std::make_unique<::std::vector<::std::string>>(); SimpleService_unique_words_pargs pargs() { SimpleService_unique_words_pargs args; args.get<0>().value = uarg_words.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_words) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.unique_words", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "unique_words", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "unique_words"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr>>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "unique_words" , return_unique_words , throw_wrapped_unique_words , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_unique_words(std::move(cb), std::move(args.uarg_words)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_unique_words(apache::thrift::ContextStack* ctx, ::std::set<::std::string> const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_unique_words_presult result; result.get<0>().value = const_cast<::std::set<::std::string>*>(&_return); result.setIsSet(0, true); return serializeResponse("unique_words", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_unique_words(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "unique_words"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_words_count(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_words_count, this); } template void SimpleServiceAsyncProcessor::executeRequest_words_count(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::vector<::std::string>> uarg_words = std::make_unique<::std::vector<::std::string>>(); SimpleService_words_count_pargs pargs() { SimpleService_words_count_pargs args; args.get<0>().value = uarg_words.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_words) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.words_count", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "words_count", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "words_count"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr>>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "words_count" , return_words_count , throw_wrapped_words_count , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_words_count(std::move(cb), std::move(args.uarg_words)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_words_count(apache::thrift::ContextStack* ctx, ::std::map<::std::string, ::std::int16_t> const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_words_count_presult result; result.get<0>().value = const_cast<::std::map<::std::string, ::std::int16_t>*>(&_return); result.setIsSet(0, true); return serializeResponse("words_count", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_words_count(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "words_count"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_set_enum(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_set_enum, this); } template void SimpleServiceAsyncProcessor::executeRequest_set_enum(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { ::py3::simple::AnEnum uarg_in_enum{static_cast<::py3::simple::AnEnum>(0)}; SimpleService_set_enum_pargs pargs() { SimpleService_set_enum_pargs args; args.get<0>().value = &uarg_in_enum; return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(uarg_in_enum) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.set_enum", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "set_enum", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "set_enum"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr<::py3::simple::AnEnum>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "set_enum" , return_set_enum , throw_wrapped_set_enum , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_set_enum(std::move(cb), args.uarg_in_enum); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_set_enum(apache::thrift::ContextStack* ctx, ::py3::simple::AnEnum const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_set_enum_presult result; result.get<0>().value = const_cast<::py3::simple::AnEnum*>(&_return); result.setIsSet(0, true); return serializeResponse("set_enum", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_set_enum(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "set_enum"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_list_of_lists(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_list_of_lists, this); } template void SimpleServiceAsyncProcessor::executeRequest_list_of_lists(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { ::std::int16_t uarg_num_lists{0}; ::std::int16_t uarg_num_items{0}; SimpleService_list_of_lists_pargs pargs() { SimpleService_list_of_lists_pargs args; args.get<0>().value = &uarg_num_lists; args.get<1>().value = &uarg_num_items; return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(uarg_num_lists), std::as_const(uarg_num_items) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.list_of_lists", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "list_of_lists", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "list_of_lists"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr>>>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "list_of_lists" , return_list_of_lists , throw_wrapped_list_of_lists , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_list_of_lists(std::move(cb), args.uarg_num_lists, args.uarg_num_items); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_list_of_lists(apache::thrift::ContextStack* ctx, ::std::vector<::std::vector<::std::int32_t>> const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_list_of_lists_presult result; result.get<0>().value = const_cast<::std::vector<::std::vector<::std::int32_t>>*>(&_return); result.setIsSet(0, true); return serializeResponse("list_of_lists", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_list_of_lists(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "list_of_lists"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_word_character_frequency(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_word_character_frequency, this); } template void SimpleServiceAsyncProcessor::executeRequest_word_character_frequency(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::string> uarg_sentence = std::make_unique<::std::string>(); SimpleService_word_character_frequency_pargs pargs() { SimpleService_word_character_frequency_pargs args; args.get<0>().value = uarg_sentence.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_sentence) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.word_character_frequency", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "word_character_frequency", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "word_character_frequency"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr>>>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "word_character_frequency" , return_word_character_frequency , throw_wrapped_word_character_frequency , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_word_character_frequency(std::move(cb), std::move(args.uarg_sentence)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_word_character_frequency(apache::thrift::ContextStack* ctx, ::std::map<::std::string, ::std::map<::std::string, ::std::int32_t>> const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_word_character_frequency_presult result; result.get<0>().value = const_cast<::std::map<::std::string, ::std::map<::std::string, ::std::int32_t>>*>(&_return); result.setIsSet(0, true); return serializeResponse("word_character_frequency", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_word_character_frequency(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "word_character_frequency"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_list_of_sets(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_list_of_sets, this); } template void SimpleServiceAsyncProcessor::executeRequest_list_of_sets(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::string> uarg_some_words = std::make_unique<::std::string>(); SimpleService_list_of_sets_pargs pargs() { SimpleService_list_of_sets_pargs args; args.get<0>().value = uarg_some_words.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_some_words) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.list_of_sets", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "list_of_sets", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "list_of_sets"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr>>>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "list_of_sets" , return_list_of_sets , throw_wrapped_list_of_sets , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_list_of_sets(std::move(cb), std::move(args.uarg_some_words)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_list_of_sets(apache::thrift::ContextStack* ctx, ::std::vector<::std::set<::std::string>> const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_list_of_sets_presult result; result.get<0>().value = const_cast<::std::vector<::std::set<::std::string>>*>(&_return); result.setIsSet(0, true); return serializeResponse("list_of_sets", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_list_of_sets(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "list_of_sets"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_nested_map_argument(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_nested_map_argument, this); } template void SimpleServiceAsyncProcessor::executeRequest_nested_map_argument(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::map<::std::string, ::std::vector<::py3::simple::SimpleStruct>>> uarg_struct_map = std::make_unique<::std::map<::std::string, ::std::vector<::py3::simple::SimpleStruct>>>(); SimpleService_nested_map_argument_pargs pargs() { SimpleService_nested_map_argument_pargs args; args.get<0>().value = uarg_struct_map.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_struct_map) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.nested_map_argument", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "nested_map_argument", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "nested_map_argument"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr<::std::int32_t>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "nested_map_argument" , return_nested_map_argument , throw_wrapped_nested_map_argument , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_nested_map_argument(std::move(cb), std::move(args.uarg_struct_map)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_nested_map_argument(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_nested_map_argument_presult result; result.get<0>().value = const_cast<::std::int32_t*>(&_return); result.setIsSet(0, true); return serializeResponse("nested_map_argument", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_nested_map_argument(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "nested_map_argument"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_make_sentence(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_make_sentence, this); } template void SimpleServiceAsyncProcessor::executeRequest_make_sentence(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::vector<::std::vector<::std::string>>> uarg_word_chars = std::make_unique<::std::vector<::std::vector<::std::string>>>(); SimpleService_make_sentence_pargs pargs() { SimpleService_make_sentence_pargs args; args.get<0>().value = uarg_word_chars.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_word_chars) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.make_sentence", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "make_sentence", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "make_sentence"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "make_sentence" , return_make_sentence , throw_wrapped_make_sentence , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_make_sentence(std::move(cb), std::move(args.uarg_word_chars)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_make_sentence(apache::thrift::ContextStack* ctx, ::std::string const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_make_sentence_presult result; result.get<0>().value = const_cast<::std::string*>(&_return); result.setIsSet(0, true); return serializeResponse("make_sentence", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_make_sentence(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "make_sentence"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_get_union(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_get_union, this); } template void SimpleServiceAsyncProcessor::executeRequest_get_union(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::vector<::std::set<::std::int32_t>>> uarg_sets = std::make_unique<::std::vector<::std::set<::std::int32_t>>>(); SimpleService_get_union_pargs pargs() { SimpleService_get_union_pargs args; args.get<0>().value = uarg_sets.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_sets) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.get_union", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "get_union", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "get_union"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr>>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "get_union" , return_get_union , throw_wrapped_get_union , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_get_union(std::move(cb), std::move(args.uarg_sets)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_get_union(apache::thrift::ContextStack* ctx, ::std::set<::std::int32_t> const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_get_union_presult result; result.get<0>().value = const_cast<::std::set<::std::int32_t>*>(&_return); result.setIsSet(0, true); return serializeResponse("get_union", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_get_union(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "get_union"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_get_keys(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_get_keys, this); } template void SimpleServiceAsyncProcessor::executeRequest_get_keys(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::vector<::std::map<::std::string, ::std::string>>> uarg_string_map = std::make_unique<::std::vector<::std::map<::std::string, ::std::string>>>(); SimpleService_get_keys_pargs pargs() { SimpleService_get_keys_pargs args; args.get<0>().value = uarg_string_map.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_string_map) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.get_keys", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "get_keys", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "get_keys"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr>>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "get_keys" , return_get_keys , throw_wrapped_get_keys , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_get_keys(std::move(cb), std::move(args.uarg_string_map)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_get_keys(apache::thrift::ContextStack* ctx, ::std::set<::std::string> const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_get_keys_presult result; result.get<0>().value = const_cast<::std::set<::std::string>*>(&_return); result.setIsSet(0, true); return serializeResponse("get_keys", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_get_keys(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "get_keys"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_lookup_double(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_lookup_double, this); } template void SimpleServiceAsyncProcessor::executeRequest_lookup_double(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { ::std::int32_t uarg_key{0}; SimpleService_lookup_double_pargs pargs() { SimpleService_lookup_double_pargs args; args.get<0>().value = &uarg_key; return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(uarg_key) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.lookup_double", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "lookup_double", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "lookup_double"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "lookup_double" , return_lookup_double , throw_wrapped_lookup_double , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_lookup_double(std::move(cb), args.uarg_key); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_lookup_double(apache::thrift::ContextStack* ctx, double const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_lookup_double_presult result; result.get<0>().value = const_cast(&_return); result.setIsSet(0, true); return serializeResponse("lookup_double", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_lookup_double(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "lookup_double"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_retrieve_binary(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_retrieve_binary, this); } template void SimpleServiceAsyncProcessor::executeRequest_retrieve_binary(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::string> uarg_something = std::make_unique<::std::string>(); SimpleService_retrieve_binary_pargs pargs() { SimpleService_retrieve_binary_pargs args; args.get<0>().value = uarg_something.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_something) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.retrieve_binary", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "retrieve_binary", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "retrieve_binary"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "retrieve_binary" , return_retrieve_binary , throw_wrapped_retrieve_binary , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_retrieve_binary(std::move(cb), std::move(args.uarg_something)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_retrieve_binary(apache::thrift::ContextStack* ctx, ::std::string const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_retrieve_binary_presult result; result.get<0>().value = const_cast<::std::string*>(&_return); result.setIsSet(0, true); return serializeResponse("retrieve_binary", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_retrieve_binary(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "retrieve_binary"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_contain_binary(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_contain_binary, this); } template void SimpleServiceAsyncProcessor::executeRequest_contain_binary(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::vector<::std::string>> uarg_binaries = std::make_unique<::std::vector<::std::string>>(); SimpleService_contain_binary_pargs pargs() { SimpleService_contain_binary_pargs args; args.get<0>().value = uarg_binaries.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_binaries) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.contain_binary", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "contain_binary", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "contain_binary"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr>>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "contain_binary" , return_contain_binary , throw_wrapped_contain_binary , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_contain_binary(std::move(cb), std::move(args.uarg_binaries)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_contain_binary(apache::thrift::ContextStack* ctx, ::std::set<::std::string> const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_contain_binary_presult result; result.get<0>().value = const_cast<::std::set<::std::string>*>(&_return); result.setIsSet(0, true); return serializeResponse("contain_binary", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_contain_binary(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "contain_binary"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_contain_enum(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_contain_enum, this); } template void SimpleServiceAsyncProcessor::executeRequest_contain_enum(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::std::vector<::py3::simple::AnEnum>> uarg_the_enum = std::make_unique<::std::vector<::py3::simple::AnEnum>>(); SimpleService_contain_enum_pargs pargs() { SimpleService_contain_enum_pargs args; args.get<0>().value = uarg_the_enum.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_the_enum) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.contain_enum", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "contain_enum", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "contain_enum"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr>>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "contain_enum" , return_contain_enum , throw_wrapped_contain_enum , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_contain_enum(std::move(cb), std::move(args.uarg_the_enum)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_contain_enum(apache::thrift::ContextStack* ctx, ::std::vector<::py3::simple::AnEnum> const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_contain_enum_presult result; result.get<0>().value = const_cast<::std::vector<::py3::simple::AnEnum>*>(&_return); result.setIsSet(0, true); return serializeResponse("contain_enum", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_contain_enum(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "contain_enum"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_get_binary_union_struct(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_get_binary_union_struct, this); } template void SimpleServiceAsyncProcessor::executeRequest_get_binary_union_struct(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { std::unique_ptr<::py3::simple::BinaryUnion> uarg_u = std::make_unique<::py3::simple::BinaryUnion>(); SimpleService_get_binary_union_struct_pargs pargs() { SimpleService_get_binary_union_struct_pargs args; args.get<0>().value = uarg_u.get(); return args; } auto asTupleOfRefs() & { return std::tie( std::as_const(*uarg_u) ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.get_binary_union_struct", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "get_binary_union_struct", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "get_binary_union_struct"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "get_binary_union_struct" , return_get_binary_union_struct , throw_wrapped_get_binary_union_struct , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_get_binary_union_struct(std::move(cb), std::move(args.uarg_u)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_get_binary_union_struct(apache::thrift::ContextStack* ctx, ::py3::simple::BinaryUnionStruct const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_get_binary_union_struct_presult result; result.get<0>().value = const_cast<::py3::simple::BinaryUnionStruct*>(&_return); result.setIsSet(0, true); return serializeResponse("get_binary_union_struct", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_get_binary_union_struct(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "get_binary_union_struct"); return; } } template void SimpleServiceAsyncProcessor::setUpAndProcess_get_struct_hidden(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::executeRequest_get_struct_hidden, this); } template void SimpleServiceAsyncProcessor::executeRequest_get_struct_hidden(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); struct ArgsState { SimpleService_get_struct_hidden_pargs pargs() { SimpleService_get_struct_hidden_pargs args; return args; } auto asTupleOfRefs() & { return std::tie( ); } } args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "SimpleService.get_struct_hidden", serverRequest.requestContext()); try { auto pargs = args.pargs(); deserializeRequest(pargs, "get_struct_hidden", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "get_struct_hidden"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = apache::thrift::HandlerCallbackPtr>::make( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , this->getServiceName() , "get_struct_hidden" , return_get_struct_hidden , throw_wrapped_get_struct_hidden , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); const auto makeExecuteHandler = [&] { return [ifacePtr = iface_](auto&& cb, ArgsState args) mutable { (void)args; ifacePtr->async_tm_get_struct_hidden(std::move(cb)); }; }; #if FOLLY_HAS_COROUTINES if (apache::thrift::detail::shouldProcessServiceInterceptorsOnRequest(*callback)) { [](auto callback, auto executeHandler, ArgsState args) -> folly::coro::Task { auto argRefs = args.asTupleOfRefs(); co_await apache::thrift::detail::processServiceInterceptorsOnRequest( *callback, apache::thrift::detail::ServiceInterceptorOnRequestArguments(argRefs)); executeHandler(std::move(callback), std::move(args)); }(std::move(callback), makeExecuteHandler(), std::move(args)) .scheduleOn(apache::thrift::detail::ServerRequestHelper::executor(serverRequest)) .startInlineUnsafe(); } else { makeExecuteHandler()(std::move(callback), std::move(args)); } #else makeExecuteHandler()(std::move(callback), std::move(args)); #endif // FOLLY_HAS_COROUTINES } template apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_get_struct_hidden(apache::thrift::ContextStack* ctx, ::py3::simple::SimpleStruct const& _return) { ProtocolOut_ prot; ::py3::simple::SimpleService_get_struct_hidden_presult result; result.get<0>().value = const_cast<::py3::simple::SimpleStruct*>(&_return); result.setIsSet(0, true); return serializeResponse("get_struct_hidden", &prot, ctx, result); } template void SimpleServiceAsyncProcessor::throw_wrapped_get_struct_hidden(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "get_struct_hidden"); return; } } } // namespace py3::simple