1 /**
2  * Autogenerated by Thrift for src/module.thrift
3  *
4  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5  *  @generated @nocommit
6  */
7 #pragma once
8 
9 #include "thrift/compiler/test/fixtures/py3/gen-py3cpp/SimpleService.h"
10 
11 #include <thrift/lib/cpp2/gen/service_tcc.h>
12 
13 namespace py3 { namespace simple {
14 typedef apache::thrift::ThriftPresult<false> SimpleService_get_five_pargs;
15 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> SimpleService_get_five_presult;
16 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::integral, ::std::int32_t*>> SimpleService_add_five_pargs;
17 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> SimpleService_add_five_presult;
18 typedef apache::thrift::ThriftPresult<false> SimpleService_do_nothing_pargs;
19 typedef apache::thrift::ThriftPresult<true> SimpleService_do_nothing_presult;
20 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::string, ::std::string*>, apache::thrift::FieldData<2, ::apache::thrift::type_class::string, ::std::string*>> SimpleService_concat_pargs;
21 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::string, ::std::string*>> SimpleService_concat_presult;
22 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::py3::simple::SimpleStruct*>> SimpleService_get_value_pargs;
23 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> SimpleService_get_value_presult;
24 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::integral, bool*>> SimpleService_negate_pargs;
25 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, bool*>> SimpleService_negate_presult;
26 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::integral, ::std::int8_t*>> SimpleService_tiny_pargs;
27 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int8_t*>> SimpleService_tiny_presult;
28 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::integral, ::std::int16_t*>> SimpleService_small_pargs;
29 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int16_t*>> SimpleService_small_presult;
30 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::integral, ::std::int64_t*>> SimpleService_big_pargs;
31 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int64_t*>> SimpleService_big_presult;
32 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::floating_point, double*>> SimpleService_two_pargs;
33 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::floating_point, double*>> SimpleService_two_presult;
34 typedef apache::thrift::ThriftPresult<false> SimpleService_expected_exception_pargs;
35 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::py3::simple::SimpleException>> SimpleService_expected_exception_presult;
36 typedef apache::thrift::ThriftPresult<false> SimpleService_unexpected_exception_pargs;
37 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> SimpleService_unexpected_exception_presult;
38 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int16_t>*>> SimpleService_sum_i16_list_pargs;
39 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> SimpleService_sum_i16_list_presult;
40 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>*>> SimpleService_sum_i32_list_pargs;
41 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> SimpleService_sum_i32_list_presult;
42 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int64_t>*>> SimpleService_sum_i64_list_pargs;
43 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> SimpleService_sum_i64_list_presult;
44 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::list<::apache::thrift::type_class::string>, ::std::vector<::std::string>*>> SimpleService_concat_many_pargs;
45 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::string, ::std::string*>> SimpleService_concat_many_presult;
46 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>, ::std::vector<::py3::simple::SimpleStruct>*>> SimpleService_count_structs_pargs;
47 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> SimpleService_count_structs_presult;
48 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::set<::apache::thrift::type_class::integral>, ::std::set<::std::int32_t>*>> SimpleService_sum_set_pargs;
49 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> SimpleService_sum_set_presult;
50 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::set<::apache::thrift::type_class::string>, ::std::set<::std::string>*>, apache::thrift::FieldData<2, ::apache::thrift::type_class::string, ::std::string*>> SimpleService_contains_word_pargs;
51 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, bool*>> SimpleService_contains_word_presult;
52 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::string>, ::std::map<::std::string, ::std::string>*>, apache::thrift::FieldData<2, ::apache::thrift::type_class::string, ::std::string*>> SimpleService_get_map_value_pargs;
53 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::string, ::std::string*>> SimpleService_get_map_value_presult;
54 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::structure>, ::std::map<::std::string, ::py3::simple::SimpleStruct>*>> SimpleService_map_length_pargs;
55 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int16_t*>> SimpleService_map_length_presult;
56 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::integral>, ::std::map<::std::string, ::std::int16_t>*>> SimpleService_sum_map_values_pargs;
57 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int16_t*>> SimpleService_sum_map_values_presult;
58 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::py3::simple::ComplexStruct*>> SimpleService_complex_sum_i32_pargs;
59 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> SimpleService_complex_sum_i32_presult;
60 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::py3::simple::ComplexStruct*>> SimpleService_repeat_name_pargs;
61 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::string, ::std::string*>> SimpleService_repeat_name_presult;
62 typedef apache::thrift::ThriftPresult<false> SimpleService_get_struct_pargs;
63 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::structure, ::py3::simple::SimpleStruct*>> SimpleService_get_struct_presult;
64 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::integral, ::std::int16_t*>> SimpleService_fib_pargs;
65 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::list<::apache::thrift::type_class::integral>, ::std::vector<::std::int32_t>*>> SimpleService_fib_presult;
66 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::list<::apache::thrift::type_class::string>, ::std::vector<::std::string>*>> SimpleService_unique_words_pargs;
67 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::set<::apache::thrift::type_class::string>, ::std::set<::std::string>*>> SimpleService_unique_words_presult;
68 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::list<::apache::thrift::type_class::string>, ::std::vector<::std::string>*>> SimpleService_words_count_pargs;
69 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::integral>, ::std::map<::std::string, ::std::int16_t>*>> SimpleService_words_count_presult;
70 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::enumeration, ::py3::simple::AnEnum*>> SimpleService_set_enum_pargs;
71 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::enumeration, ::py3::simple::AnEnum*>> SimpleService_set_enum_presult;
72 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::integral, ::std::int16_t*>, apache::thrift::FieldData<2, ::apache::thrift::type_class::integral, ::std::int16_t*>> SimpleService_list_of_lists_pargs;
73 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::list<::apache::thrift::type_class::list<::apache::thrift::type_class::integral>>, ::std::vector<::std::vector<::std::int32_t>>*>> SimpleService_list_of_lists_presult;
74 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::string, ::std::string*>> SimpleService_word_character_frequency_pargs;
75 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::integral>>, ::std::map<::std::string, ::std::map<::std::string, ::std::int32_t>>*>> SimpleService_word_character_frequency_presult;
76 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::string, ::std::string*>> SimpleService_list_of_sets_pargs;
77 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::list<::apache::thrift::type_class::set<::apache::thrift::type_class::string>>, ::std::vector<::std::set<::std::string>>*>> SimpleService_list_of_sets_presult;
78 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>>, ::std::map<::std::string, ::std::vector<::py3::simple::SimpleStruct>>*>> SimpleService_nested_map_argument_pargs;
79 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> SimpleService_nested_map_argument_presult;
80 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::list<::apache::thrift::type_class::list<::apache::thrift::type_class::string>>, ::std::vector<::std::vector<::std::string>>*>> SimpleService_make_sentence_pargs;
81 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::string, ::std::string*>> SimpleService_make_sentence_presult;
82 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::list<::apache::thrift::type_class::set<::apache::thrift::type_class::integral>>, ::std::vector<::std::set<::std::int32_t>>*>> SimpleService_get_union_pargs;
83 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::set<::apache::thrift::type_class::integral>, ::std::set<::std::int32_t>*>> SimpleService_get_union_presult;
84 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::list<::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::string>>, ::std::vector<::std::map<::std::string, ::std::string>>*>> SimpleService_get_keys_pargs;
85 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::set<::apache::thrift::type_class::string>, ::std::set<::std::string>*>> SimpleService_get_keys_presult;
86 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::integral, ::std::int32_t*>> SimpleService_lookup_double_pargs;
87 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::floating_point, double*>> SimpleService_lookup_double_presult;
88 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::binary, ::std::string*>> SimpleService_retrieve_binary_pargs;
89 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::binary, ::std::string*>> SimpleService_retrieve_binary_presult;
90 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::list<::apache::thrift::type_class::binary>, ::std::vector<::std::string>*>> SimpleService_contain_binary_pargs;
91 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::set<::apache::thrift::type_class::binary>, ::std::set<::std::string>*>> SimpleService_contain_binary_presult;
92 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::list<::apache::thrift::type_class::enumeration>, ::std::vector<::py3::simple::AnEnum>*>> SimpleService_contain_enum_pargs;
93 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::list<::apache::thrift::type_class::enumeration>, ::std::vector<::py3::simple::AnEnum>*>> SimpleService_contain_enum_presult;
94 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::variant, ::py3::simple::BinaryUnion*>> SimpleService_get_binary_union_struct_pargs;
95 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::structure, ::py3::simple::BinaryUnionStruct*>> SimpleService_get_binary_union_struct_presult;
96 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_get_five(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)97 void SimpleServiceAsyncProcessor::setUpAndProcess_get_five(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
98   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
99     return;
100   }
101   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
102   ctx->setRequestExecutionScope(std::move(scope));
103   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_get_five<ProtocolIn_, ProtocolOut_>, this);
104 }
105 
106 template <typename ProtocolIn_, typename ProtocolOut_>
process_get_five(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)107 void SimpleServiceAsyncProcessor::process_get_five(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
108   if (!req->getShouldStartProcessing()) {
109     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
110     return;
111   }
112   // make sure getRequestContext is null
113   // so async calls don't accidentally use it
114   iface_->setRequestContext(nullptr);
115   SimpleService_get_five_pargs args;
116   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.get_five", ctx));
117   try {
118     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
119   }
120   catch (const std::exception& ex) {
121     folly::exception_wrapper ew(std::current_exception(), ex);
122     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
123         ew, std::move(req), ctx, eb, "get_five");
124     return;
125   }
126   auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int32_t>>(std::move(req), std::move(ctxStack), return_get_five<ProtocolIn_,ProtocolOut_>, throw_wrapped_get_five<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
127   iface_->async_tm_get_five(std::move(callback));
128 }
129 
130 template <class ProtocolIn_, class ProtocolOut_>
return_get_five(apache::thrift::ContextStack * ctx,::std::int32_t const & _return)131 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_get_five(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) {
132   ProtocolOut_ prot;
133   SimpleService_get_five_presult result;
134   result.get<0>().value = const_cast<::std::int32_t*>(&_return);
135   result.setIsSet(0, true);
136   return serializeResponse(&prot, ctx, result);
137 }
138 
139 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_get_five(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)140 void SimpleServiceAsyncProcessor::throw_wrapped_get_five(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
141   if (!ew) {
142     return;
143   }
144   {
145     (void)protoSeqId;
146     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
147         ew, std::move(req), reqCtx, ctx, "get_five");
148     return;
149   }
150 }
151 
152 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_add_five(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)153 void SimpleServiceAsyncProcessor::setUpAndProcess_add_five(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
154   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
155     return;
156   }
157   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
158   ctx->setRequestExecutionScope(std::move(scope));
159   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_add_five<ProtocolIn_, ProtocolOut_>, this);
160 }
161 
162 template <typename ProtocolIn_, typename ProtocolOut_>
process_add_five(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)163 void SimpleServiceAsyncProcessor::process_add_five(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
164   if (!req->getShouldStartProcessing()) {
165     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
166     return;
167   }
168   // make sure getRequestContext is null
169   // so async calls don't accidentally use it
170   iface_->setRequestContext(nullptr);
171   SimpleService_add_five_pargs args;
172   ::std::int32_t uarg_num{0};
173   args.get<0>().value = &uarg_num;
174   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.add_five", ctx));
175   try {
176     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
177   }
178   catch (const std::exception& ex) {
179     folly::exception_wrapper ew(std::current_exception(), ex);
180     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
181         ew, std::move(req), ctx, eb, "add_five");
182     return;
183   }
184   auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int32_t>>(std::move(req), std::move(ctxStack), return_add_five<ProtocolIn_,ProtocolOut_>, throw_wrapped_add_five<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
185   iface_->async_tm_add_five(std::move(callback), args.get<0>().ref());
186 }
187 
188 template <class ProtocolIn_, class ProtocolOut_>
return_add_five(apache::thrift::ContextStack * ctx,::std::int32_t const & _return)189 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_add_five(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) {
190   ProtocolOut_ prot;
191   SimpleService_add_five_presult result;
192   result.get<0>().value = const_cast<::std::int32_t*>(&_return);
193   result.setIsSet(0, true);
194   return serializeResponse(&prot, ctx, result);
195 }
196 
197 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_add_five(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)198 void SimpleServiceAsyncProcessor::throw_wrapped_add_five(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
199   if (!ew) {
200     return;
201   }
202   {
203     (void)protoSeqId;
204     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
205         ew, std::move(req), reqCtx, ctx, "add_five");
206     return;
207   }
208 }
209 
210 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_do_nothing(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)211 void SimpleServiceAsyncProcessor::setUpAndProcess_do_nothing(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
212   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
213     return;
214   }
215   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
216   ctx->setRequestExecutionScope(std::move(scope));
217   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_do_nothing<ProtocolIn_, ProtocolOut_>, this);
218 }
219 
220 template <typename ProtocolIn_, typename ProtocolOut_>
process_do_nothing(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)221 void SimpleServiceAsyncProcessor::process_do_nothing(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
222   if (!req->getShouldStartProcessing()) {
223     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
224     return;
225   }
226   // make sure getRequestContext is null
227   // so async calls don't accidentally use it
228   iface_->setRequestContext(nullptr);
229   SimpleService_do_nothing_pargs args;
230   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.do_nothing", ctx));
231   try {
232     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
233   }
234   catch (const std::exception& ex) {
235     folly::exception_wrapper ew(std::current_exception(), ex);
236     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
237         ew, std::move(req), ctx, eb, "do_nothing");
238     return;
239   }
240   auto callback = std::make_unique<apache::thrift::HandlerCallback<void>>(std::move(req), std::move(ctxStack), return_do_nothing<ProtocolIn_,ProtocolOut_>, throw_wrapped_do_nothing<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
241   iface_->async_tm_do_nothing(std::move(callback));
242 }
243 
244 template <class ProtocolIn_, class ProtocolOut_>
return_do_nothing(apache::thrift::ContextStack * ctx)245 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_do_nothing(apache::thrift::ContextStack* ctx) {
246   ProtocolOut_ prot;
247   SimpleService_do_nothing_presult result;
248   return serializeResponse(&prot, ctx, result);
249 }
250 
251 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_do_nothing(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)252 void SimpleServiceAsyncProcessor::throw_wrapped_do_nothing(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
253   if (!ew) {
254     return;
255   }
256   {
257     (void)protoSeqId;
258     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
259         ew, std::move(req), reqCtx, ctx, "do_nothing");
260     return;
261   }
262 }
263 
264 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_concat(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)265 void SimpleServiceAsyncProcessor::setUpAndProcess_concat(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
266   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
267     return;
268   }
269   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
270   ctx->setRequestExecutionScope(std::move(scope));
271   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_concat<ProtocolIn_, ProtocolOut_>, this);
272 }
273 
274 template <typename ProtocolIn_, typename ProtocolOut_>
process_concat(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)275 void SimpleServiceAsyncProcessor::process_concat(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
276   if (!req->getShouldStartProcessing()) {
277     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
278     return;
279   }
280   // make sure getRequestContext is null
281   // so async calls don't accidentally use it
282   iface_->setRequestContext(nullptr);
283   SimpleService_concat_pargs args;
284   auto uarg_first = std::make_unique<::std::string>();
285   args.get<0>().value = uarg_first.get();
286   auto uarg_second = std::make_unique<::std::string>();
287   args.get<1>().value = uarg_second.get();
288   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.concat", ctx));
289   try {
290     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
291   }
292   catch (const std::exception& ex) {
293     folly::exception_wrapper ew(std::current_exception(), ex);
294     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
295         ew, std::move(req), ctx, eb, "concat");
296     return;
297   }
298   auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::string>>>(std::move(req), std::move(ctxStack), return_concat<ProtocolIn_,ProtocolOut_>, throw_wrapped_concat<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
299   iface_->async_tm_concat(std::move(callback), std::move(uarg_first), std::move(uarg_second));
300 }
301 
302 template <class ProtocolIn_, class ProtocolOut_>
return_concat(apache::thrift::ContextStack * ctx,::std::string const & _return)303 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_concat(apache::thrift::ContextStack* ctx, ::std::string const& _return) {
304   ProtocolOut_ prot;
305   SimpleService_concat_presult result;
306   result.get<0>().value = const_cast<::std::string*>(&_return);
307   result.setIsSet(0, true);
308   return serializeResponse(&prot, ctx, result);
309 }
310 
311 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_concat(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)312 void SimpleServiceAsyncProcessor::throw_wrapped_concat(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
313   if (!ew) {
314     return;
315   }
316   {
317     (void)protoSeqId;
318     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
319         ew, std::move(req), reqCtx, ctx, "concat");
320     return;
321   }
322 }
323 
324 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_get_value(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)325 void SimpleServiceAsyncProcessor::setUpAndProcess_get_value(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
326   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
327     return;
328   }
329   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
330   ctx->setRequestExecutionScope(std::move(scope));
331   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_get_value<ProtocolIn_, ProtocolOut_>, this);
332 }
333 
334 template <typename ProtocolIn_, typename ProtocolOut_>
process_get_value(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)335 void SimpleServiceAsyncProcessor::process_get_value(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
336   if (!req->getShouldStartProcessing()) {
337     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
338     return;
339   }
340   // make sure getRequestContext is null
341   // so async calls don't accidentally use it
342   iface_->setRequestContext(nullptr);
343   SimpleService_get_value_pargs args;
344   auto uarg_simple_struct = std::make_unique<::py3::simple::SimpleStruct>();
345   args.get<0>().value = uarg_simple_struct.get();
346   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.get_value", ctx));
347   try {
348     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
349   }
350   catch (const std::exception& ex) {
351     folly::exception_wrapper ew(std::current_exception(), ex);
352     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
353         ew, std::move(req), ctx, eb, "get_value");
354     return;
355   }
356   auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int32_t>>(std::move(req), std::move(ctxStack), return_get_value<ProtocolIn_,ProtocolOut_>, throw_wrapped_get_value<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
357   iface_->async_tm_get_value(std::move(callback), std::move(uarg_simple_struct));
358 }
359 
360 template <class ProtocolIn_, class ProtocolOut_>
return_get_value(apache::thrift::ContextStack * ctx,::std::int32_t const & _return)361 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_get_value(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) {
362   ProtocolOut_ prot;
363   SimpleService_get_value_presult result;
364   result.get<0>().value = const_cast<::std::int32_t*>(&_return);
365   result.setIsSet(0, true);
366   return serializeResponse(&prot, ctx, result);
367 }
368 
369 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_get_value(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)370 void SimpleServiceAsyncProcessor::throw_wrapped_get_value(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
371   if (!ew) {
372     return;
373   }
374   {
375     (void)protoSeqId;
376     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
377         ew, std::move(req), reqCtx, ctx, "get_value");
378     return;
379   }
380 }
381 
382 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_negate(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)383 void SimpleServiceAsyncProcessor::setUpAndProcess_negate(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
384   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
385     return;
386   }
387   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
388   ctx->setRequestExecutionScope(std::move(scope));
389   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_negate<ProtocolIn_, ProtocolOut_>, this);
390 }
391 
392 template <typename ProtocolIn_, typename ProtocolOut_>
process_negate(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)393 void SimpleServiceAsyncProcessor::process_negate(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
394   if (!req->getShouldStartProcessing()) {
395     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
396     return;
397   }
398   // make sure getRequestContext is null
399   // so async calls don't accidentally use it
400   iface_->setRequestContext(nullptr);
401   SimpleService_negate_pargs args;
402   bool uarg_input{0};
403   args.get<0>().value = &uarg_input;
404   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.negate", ctx));
405   try {
406     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
407   }
408   catch (const std::exception& ex) {
409     folly::exception_wrapper ew(std::current_exception(), ex);
410     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
411         ew, std::move(req), ctx, eb, "negate");
412     return;
413   }
414   auto callback = std::make_unique<apache::thrift::HandlerCallback<bool>>(std::move(req), std::move(ctxStack), return_negate<ProtocolIn_,ProtocolOut_>, throw_wrapped_negate<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
415   iface_->async_tm_negate(std::move(callback), args.get<0>().ref());
416 }
417 
418 template <class ProtocolIn_, class ProtocolOut_>
return_negate(apache::thrift::ContextStack * ctx,bool const & _return)419 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_negate(apache::thrift::ContextStack* ctx, bool const& _return) {
420   ProtocolOut_ prot;
421   SimpleService_negate_presult result;
422   result.get<0>().value = const_cast<bool*>(&_return);
423   result.setIsSet(0, true);
424   return serializeResponse(&prot, ctx, result);
425 }
426 
427 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_negate(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)428 void SimpleServiceAsyncProcessor::throw_wrapped_negate(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
429   if (!ew) {
430     return;
431   }
432   {
433     (void)protoSeqId;
434     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
435         ew, std::move(req), reqCtx, ctx, "negate");
436     return;
437   }
438 }
439 
440 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_tiny(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)441 void SimpleServiceAsyncProcessor::setUpAndProcess_tiny(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
442   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
443     return;
444   }
445   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
446   ctx->setRequestExecutionScope(std::move(scope));
447   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_tiny<ProtocolIn_, ProtocolOut_>, this);
448 }
449 
450 template <typename ProtocolIn_, typename ProtocolOut_>
process_tiny(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)451 void SimpleServiceAsyncProcessor::process_tiny(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
452   if (!req->getShouldStartProcessing()) {
453     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
454     return;
455   }
456   // make sure getRequestContext is null
457   // so async calls don't accidentally use it
458   iface_->setRequestContext(nullptr);
459   SimpleService_tiny_pargs args;
460   ::std::int8_t uarg_input{0};
461   args.get<0>().value = &uarg_input;
462   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.tiny", ctx));
463   try {
464     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
465   }
466   catch (const std::exception& ex) {
467     folly::exception_wrapper ew(std::current_exception(), ex);
468     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
469         ew, std::move(req), ctx, eb, "tiny");
470     return;
471   }
472   auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int8_t>>(std::move(req), std::move(ctxStack), return_tiny<ProtocolIn_,ProtocolOut_>, throw_wrapped_tiny<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
473   iface_->async_tm_tiny(std::move(callback), args.get<0>().ref());
474 }
475 
476 template <class ProtocolIn_, class ProtocolOut_>
return_tiny(apache::thrift::ContextStack * ctx,::std::int8_t const & _return)477 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_tiny(apache::thrift::ContextStack* ctx, ::std::int8_t const& _return) {
478   ProtocolOut_ prot;
479   SimpleService_tiny_presult result;
480   result.get<0>().value = const_cast<::std::int8_t*>(&_return);
481   result.setIsSet(0, true);
482   return serializeResponse(&prot, ctx, result);
483 }
484 
485 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_tiny(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)486 void SimpleServiceAsyncProcessor::throw_wrapped_tiny(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
487   if (!ew) {
488     return;
489   }
490   {
491     (void)protoSeqId;
492     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
493         ew, std::move(req), reqCtx, ctx, "tiny");
494     return;
495   }
496 }
497 
498 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_small(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)499 void SimpleServiceAsyncProcessor::setUpAndProcess_small(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
500   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
501     return;
502   }
503   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
504   ctx->setRequestExecutionScope(std::move(scope));
505   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_small<ProtocolIn_, ProtocolOut_>, this);
506 }
507 
508 template <typename ProtocolIn_, typename ProtocolOut_>
process_small(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)509 void SimpleServiceAsyncProcessor::process_small(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
510   if (!req->getShouldStartProcessing()) {
511     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
512     return;
513   }
514   // make sure getRequestContext is null
515   // so async calls don't accidentally use it
516   iface_->setRequestContext(nullptr);
517   SimpleService_small_pargs args;
518   ::std::int16_t uarg_input{0};
519   args.get<0>().value = &uarg_input;
520   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.small", ctx));
521   try {
522     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
523   }
524   catch (const std::exception& ex) {
525     folly::exception_wrapper ew(std::current_exception(), ex);
526     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
527         ew, std::move(req), ctx, eb, "small");
528     return;
529   }
530   auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int16_t>>(std::move(req), std::move(ctxStack), return_small<ProtocolIn_,ProtocolOut_>, throw_wrapped_small<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
531   iface_->async_tm_small(std::move(callback), args.get<0>().ref());
532 }
533 
534 template <class ProtocolIn_, class ProtocolOut_>
return_small(apache::thrift::ContextStack * ctx,::std::int16_t const & _return)535 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_small(apache::thrift::ContextStack* ctx, ::std::int16_t const& _return) {
536   ProtocolOut_ prot;
537   SimpleService_small_presult result;
538   result.get<0>().value = const_cast<::std::int16_t*>(&_return);
539   result.setIsSet(0, true);
540   return serializeResponse(&prot, ctx, result);
541 }
542 
543 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_small(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)544 void SimpleServiceAsyncProcessor::throw_wrapped_small(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
545   if (!ew) {
546     return;
547   }
548   {
549     (void)protoSeqId;
550     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
551         ew, std::move(req), reqCtx, ctx, "small");
552     return;
553   }
554 }
555 
556 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_big(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)557 void SimpleServiceAsyncProcessor::setUpAndProcess_big(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
558   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
559     return;
560   }
561   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
562   ctx->setRequestExecutionScope(std::move(scope));
563   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_big<ProtocolIn_, ProtocolOut_>, this);
564 }
565 
566 template <typename ProtocolIn_, typename ProtocolOut_>
process_big(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)567 void SimpleServiceAsyncProcessor::process_big(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
568   if (!req->getShouldStartProcessing()) {
569     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
570     return;
571   }
572   // make sure getRequestContext is null
573   // so async calls don't accidentally use it
574   iface_->setRequestContext(nullptr);
575   SimpleService_big_pargs args;
576   ::std::int64_t uarg_input{0};
577   args.get<0>().value = &uarg_input;
578   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.big", ctx));
579   try {
580     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
581   }
582   catch (const std::exception& ex) {
583     folly::exception_wrapper ew(std::current_exception(), ex);
584     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
585         ew, std::move(req), ctx, eb, "big");
586     return;
587   }
588   auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int64_t>>(std::move(req), std::move(ctxStack), return_big<ProtocolIn_,ProtocolOut_>, throw_wrapped_big<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
589   iface_->async_tm_big(std::move(callback), args.get<0>().ref());
590 }
591 
592 template <class ProtocolIn_, class ProtocolOut_>
return_big(apache::thrift::ContextStack * ctx,::std::int64_t const & _return)593 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_big(apache::thrift::ContextStack* ctx, ::std::int64_t const& _return) {
594   ProtocolOut_ prot;
595   SimpleService_big_presult result;
596   result.get<0>().value = const_cast<::std::int64_t*>(&_return);
597   result.setIsSet(0, true);
598   return serializeResponse(&prot, ctx, result);
599 }
600 
601 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_big(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)602 void SimpleServiceAsyncProcessor::throw_wrapped_big(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
603   if (!ew) {
604     return;
605   }
606   {
607     (void)protoSeqId;
608     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
609         ew, std::move(req), reqCtx, ctx, "big");
610     return;
611   }
612 }
613 
614 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_two(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)615 void SimpleServiceAsyncProcessor::setUpAndProcess_two(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
616   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
617     return;
618   }
619   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
620   ctx->setRequestExecutionScope(std::move(scope));
621   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_two<ProtocolIn_, ProtocolOut_>, this);
622 }
623 
624 template <typename ProtocolIn_, typename ProtocolOut_>
process_two(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)625 void SimpleServiceAsyncProcessor::process_two(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
626   if (!req->getShouldStartProcessing()) {
627     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
628     return;
629   }
630   // make sure getRequestContext is null
631   // so async calls don't accidentally use it
632   iface_->setRequestContext(nullptr);
633   SimpleService_two_pargs args;
634   double uarg_input{0};
635   args.get<0>().value = &uarg_input;
636   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.two", ctx));
637   try {
638     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
639   }
640   catch (const std::exception& ex) {
641     folly::exception_wrapper ew(std::current_exception(), ex);
642     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
643         ew, std::move(req), ctx, eb, "two");
644     return;
645   }
646   auto callback = std::make_unique<apache::thrift::HandlerCallback<double>>(std::move(req), std::move(ctxStack), return_two<ProtocolIn_,ProtocolOut_>, throw_wrapped_two<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
647   iface_->async_tm_two(std::move(callback), args.get<0>().ref());
648 }
649 
650 template <class ProtocolIn_, class ProtocolOut_>
return_two(apache::thrift::ContextStack * ctx,double const & _return)651 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_two(apache::thrift::ContextStack* ctx, double const& _return) {
652   ProtocolOut_ prot;
653   SimpleService_two_presult result;
654   result.get<0>().value = const_cast<double*>(&_return);
655   result.setIsSet(0, true);
656   return serializeResponse(&prot, ctx, result);
657 }
658 
659 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_two(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)660 void SimpleServiceAsyncProcessor::throw_wrapped_two(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
661   if (!ew) {
662     return;
663   }
664   {
665     (void)protoSeqId;
666     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
667         ew, std::move(req), reqCtx, ctx, "two");
668     return;
669   }
670 }
671 
672 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_expected_exception(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)673 void SimpleServiceAsyncProcessor::setUpAndProcess_expected_exception(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
674   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
675     return;
676   }
677   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
678   ctx->setRequestExecutionScope(std::move(scope));
679   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_expected_exception<ProtocolIn_, ProtocolOut_>, this);
680 }
681 
682 template <typename ProtocolIn_, typename ProtocolOut_>
process_expected_exception(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)683 void SimpleServiceAsyncProcessor::process_expected_exception(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
684   if (!req->getShouldStartProcessing()) {
685     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
686     return;
687   }
688   // make sure getRequestContext is null
689   // so async calls don't accidentally use it
690   iface_->setRequestContext(nullptr);
691   SimpleService_expected_exception_pargs args;
692   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.expected_exception", ctx));
693   try {
694     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
695   }
696   catch (const std::exception& ex) {
697     folly::exception_wrapper ew(std::current_exception(), ex);
698     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
699         ew, std::move(req), ctx, eb, "expected_exception");
700     return;
701   }
702   auto callback = std::make_unique<apache::thrift::HandlerCallback<void>>(std::move(req), std::move(ctxStack), return_expected_exception<ProtocolIn_,ProtocolOut_>, throw_wrapped_expected_exception<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
703   iface_->async_tm_expected_exception(std::move(callback));
704 }
705 
706 template <class ProtocolIn_, class ProtocolOut_>
return_expected_exception(apache::thrift::ContextStack * ctx)707 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_expected_exception(apache::thrift::ContextStack* ctx) {
708   ProtocolOut_ prot;
709   SimpleService_expected_exception_presult result;
710   return serializeResponse(&prot, ctx, result);
711 }
712 
713 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_expected_exception(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)714 void SimpleServiceAsyncProcessor::throw_wrapped_expected_exception(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
715   if (!ew) {
716     return;
717   }
718   SimpleService_expected_exception_presult result;
719   if (ew.with_exception([&]( ::py3::simple::SimpleException& e) {
720     if (ctx) {
721       ctx->userExceptionWrapped(true, ew);
722     }
723     ::apache::thrift::util::appendExceptionToHeader(ew, *reqCtx);
724     ::apache::thrift::util::appendErrorClassificationToHeader< ::py3::simple::SimpleException>(ew, *reqCtx);
725     result.get<0>().ref() = e;
726     result.setIsSet(0, true);
727   }
728   )) {} else
729   {
730     (void)protoSeqId;
731     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
732         ew, std::move(req), reqCtx, ctx, "expected_exception");
733     return;
734   }
735   ProtocolOut_ prot;
736   auto response = serializeResponse(&prot, ctx, result);
737   auto payload = std::move(response).extractPayload(
738       req->includeEnvelope(), prot.protocolType(), protoSeqId, apache::thrift::MessageType::T_REPLY, "expected_exception");
739   payload.transform(reqCtx->getHeader()->getWriteTransforms());
740   return req->sendReply(std::move(payload));
741 }
742 
743 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_unexpected_exception(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)744 void SimpleServiceAsyncProcessor::setUpAndProcess_unexpected_exception(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
745   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
746     return;
747   }
748   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
749   ctx->setRequestExecutionScope(std::move(scope));
750   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_unexpected_exception<ProtocolIn_, ProtocolOut_>, this);
751 }
752 
753 template <typename ProtocolIn_, typename ProtocolOut_>
process_unexpected_exception(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)754 void SimpleServiceAsyncProcessor::process_unexpected_exception(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
755   if (!req->getShouldStartProcessing()) {
756     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
757     return;
758   }
759   // make sure getRequestContext is null
760   // so async calls don't accidentally use it
761   iface_->setRequestContext(nullptr);
762   SimpleService_unexpected_exception_pargs args;
763   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.unexpected_exception", ctx));
764   try {
765     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
766   }
767   catch (const std::exception& ex) {
768     folly::exception_wrapper ew(std::current_exception(), ex);
769     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
770         ew, std::move(req), ctx, eb, "unexpected_exception");
771     return;
772   }
773   auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int32_t>>(std::move(req), std::move(ctxStack), return_unexpected_exception<ProtocolIn_,ProtocolOut_>, throw_wrapped_unexpected_exception<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
774   iface_->async_tm_unexpected_exception(std::move(callback));
775 }
776 
777 template <class ProtocolIn_, class ProtocolOut_>
return_unexpected_exception(apache::thrift::ContextStack * ctx,::std::int32_t const & _return)778 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_unexpected_exception(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) {
779   ProtocolOut_ prot;
780   SimpleService_unexpected_exception_presult result;
781   result.get<0>().value = const_cast<::std::int32_t*>(&_return);
782   result.setIsSet(0, true);
783   return serializeResponse(&prot, ctx, result);
784 }
785 
786 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_unexpected_exception(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)787 void SimpleServiceAsyncProcessor::throw_wrapped_unexpected_exception(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
788   if (!ew) {
789     return;
790   }
791   {
792     (void)protoSeqId;
793     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
794         ew, std::move(req), reqCtx, ctx, "unexpected_exception");
795     return;
796   }
797 }
798 
799 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_sum_i16_list(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)800 void SimpleServiceAsyncProcessor::setUpAndProcess_sum_i16_list(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
801   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
802     return;
803   }
804   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
805   ctx->setRequestExecutionScope(std::move(scope));
806   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_sum_i16_list<ProtocolIn_, ProtocolOut_>, this);
807 }
808 
809 template <typename ProtocolIn_, typename ProtocolOut_>
process_sum_i16_list(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)810 void SimpleServiceAsyncProcessor::process_sum_i16_list(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
811   if (!req->getShouldStartProcessing()) {
812     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
813     return;
814   }
815   // make sure getRequestContext is null
816   // so async calls don't accidentally use it
817   iface_->setRequestContext(nullptr);
818   SimpleService_sum_i16_list_pargs args;
819   auto uarg_numbers = std::make_unique<::std::vector<::std::int16_t>>();
820   args.get<0>().value = uarg_numbers.get();
821   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.sum_i16_list", ctx));
822   try {
823     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
824   }
825   catch (const std::exception& ex) {
826     folly::exception_wrapper ew(std::current_exception(), ex);
827     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
828         ew, std::move(req), ctx, eb, "sum_i16_list");
829     return;
830   }
831   auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int32_t>>(std::move(req), std::move(ctxStack), return_sum_i16_list<ProtocolIn_,ProtocolOut_>, throw_wrapped_sum_i16_list<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
832   iface_->async_tm_sum_i16_list(std::move(callback), std::move(uarg_numbers));
833 }
834 
835 template <class ProtocolIn_, class ProtocolOut_>
return_sum_i16_list(apache::thrift::ContextStack * ctx,::std::int32_t const & _return)836 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_sum_i16_list(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) {
837   ProtocolOut_ prot;
838   SimpleService_sum_i16_list_presult result;
839   result.get<0>().value = const_cast<::std::int32_t*>(&_return);
840   result.setIsSet(0, true);
841   return serializeResponse(&prot, ctx, result);
842 }
843 
844 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_sum_i16_list(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)845 void SimpleServiceAsyncProcessor::throw_wrapped_sum_i16_list(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
846   if (!ew) {
847     return;
848   }
849   {
850     (void)protoSeqId;
851     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
852         ew, std::move(req), reqCtx, ctx, "sum_i16_list");
853     return;
854   }
855 }
856 
857 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_sum_i32_list(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)858 void SimpleServiceAsyncProcessor::setUpAndProcess_sum_i32_list(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
859   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
860     return;
861   }
862   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
863   ctx->setRequestExecutionScope(std::move(scope));
864   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_sum_i32_list<ProtocolIn_, ProtocolOut_>, this);
865 }
866 
867 template <typename ProtocolIn_, typename ProtocolOut_>
process_sum_i32_list(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)868 void SimpleServiceAsyncProcessor::process_sum_i32_list(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
869   if (!req->getShouldStartProcessing()) {
870     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
871     return;
872   }
873   // make sure getRequestContext is null
874   // so async calls don't accidentally use it
875   iface_->setRequestContext(nullptr);
876   SimpleService_sum_i32_list_pargs args;
877   auto uarg_numbers = std::make_unique<::std::vector<::std::int32_t>>();
878   args.get<0>().value = uarg_numbers.get();
879   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.sum_i32_list", ctx));
880   try {
881     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
882   }
883   catch (const std::exception& ex) {
884     folly::exception_wrapper ew(std::current_exception(), ex);
885     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
886         ew, std::move(req), ctx, eb, "sum_i32_list");
887     return;
888   }
889   auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int32_t>>(std::move(req), std::move(ctxStack), return_sum_i32_list<ProtocolIn_,ProtocolOut_>, throw_wrapped_sum_i32_list<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
890   iface_->async_tm_sum_i32_list(std::move(callback), std::move(uarg_numbers));
891 }
892 
893 template <class ProtocolIn_, class ProtocolOut_>
return_sum_i32_list(apache::thrift::ContextStack * ctx,::std::int32_t const & _return)894 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_sum_i32_list(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) {
895   ProtocolOut_ prot;
896   SimpleService_sum_i32_list_presult result;
897   result.get<0>().value = const_cast<::std::int32_t*>(&_return);
898   result.setIsSet(0, true);
899   return serializeResponse(&prot, ctx, result);
900 }
901 
902 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_sum_i32_list(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)903 void SimpleServiceAsyncProcessor::throw_wrapped_sum_i32_list(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
904   if (!ew) {
905     return;
906   }
907   {
908     (void)protoSeqId;
909     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
910         ew, std::move(req), reqCtx, ctx, "sum_i32_list");
911     return;
912   }
913 }
914 
915 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_sum_i64_list(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)916 void SimpleServiceAsyncProcessor::setUpAndProcess_sum_i64_list(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
917   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
918     return;
919   }
920   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
921   ctx->setRequestExecutionScope(std::move(scope));
922   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_sum_i64_list<ProtocolIn_, ProtocolOut_>, this);
923 }
924 
925 template <typename ProtocolIn_, typename ProtocolOut_>
process_sum_i64_list(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)926 void SimpleServiceAsyncProcessor::process_sum_i64_list(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
927   if (!req->getShouldStartProcessing()) {
928     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
929     return;
930   }
931   // make sure getRequestContext is null
932   // so async calls don't accidentally use it
933   iface_->setRequestContext(nullptr);
934   SimpleService_sum_i64_list_pargs args;
935   auto uarg_numbers = std::make_unique<::std::vector<::std::int64_t>>();
936   args.get<0>().value = uarg_numbers.get();
937   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.sum_i64_list", ctx));
938   try {
939     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
940   }
941   catch (const std::exception& ex) {
942     folly::exception_wrapper ew(std::current_exception(), ex);
943     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
944         ew, std::move(req), ctx, eb, "sum_i64_list");
945     return;
946   }
947   auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int32_t>>(std::move(req), std::move(ctxStack), return_sum_i64_list<ProtocolIn_,ProtocolOut_>, throw_wrapped_sum_i64_list<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
948   iface_->async_tm_sum_i64_list(std::move(callback), std::move(uarg_numbers));
949 }
950 
951 template <class ProtocolIn_, class ProtocolOut_>
return_sum_i64_list(apache::thrift::ContextStack * ctx,::std::int32_t const & _return)952 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_sum_i64_list(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) {
953   ProtocolOut_ prot;
954   SimpleService_sum_i64_list_presult result;
955   result.get<0>().value = const_cast<::std::int32_t*>(&_return);
956   result.setIsSet(0, true);
957   return serializeResponse(&prot, ctx, result);
958 }
959 
960 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_sum_i64_list(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)961 void SimpleServiceAsyncProcessor::throw_wrapped_sum_i64_list(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
962   if (!ew) {
963     return;
964   }
965   {
966     (void)protoSeqId;
967     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
968         ew, std::move(req), reqCtx, ctx, "sum_i64_list");
969     return;
970   }
971 }
972 
973 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_concat_many(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)974 void SimpleServiceAsyncProcessor::setUpAndProcess_concat_many(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
975   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
976     return;
977   }
978   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
979   ctx->setRequestExecutionScope(std::move(scope));
980   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_concat_many<ProtocolIn_, ProtocolOut_>, this);
981 }
982 
983 template <typename ProtocolIn_, typename ProtocolOut_>
process_concat_many(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)984 void SimpleServiceAsyncProcessor::process_concat_many(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
985   if (!req->getShouldStartProcessing()) {
986     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
987     return;
988   }
989   // make sure getRequestContext is null
990   // so async calls don't accidentally use it
991   iface_->setRequestContext(nullptr);
992   SimpleService_concat_many_pargs args;
993   auto uarg_words = std::make_unique<::std::vector<::std::string>>();
994   args.get<0>().value = uarg_words.get();
995   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.concat_many", ctx));
996   try {
997     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
998   }
999   catch (const std::exception& ex) {
1000     folly::exception_wrapper ew(std::current_exception(), ex);
1001     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1002         ew, std::move(req), ctx, eb, "concat_many");
1003     return;
1004   }
1005   auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::string>>>(std::move(req), std::move(ctxStack), return_concat_many<ProtocolIn_,ProtocolOut_>, throw_wrapped_concat_many<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1006   iface_->async_tm_concat_many(std::move(callback), std::move(uarg_words));
1007 }
1008 
1009 template <class ProtocolIn_, class ProtocolOut_>
return_concat_many(apache::thrift::ContextStack * ctx,::std::string const & _return)1010 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_concat_many(apache::thrift::ContextStack* ctx, ::std::string const& _return) {
1011   ProtocolOut_ prot;
1012   SimpleService_concat_many_presult result;
1013   result.get<0>().value = const_cast<::std::string*>(&_return);
1014   result.setIsSet(0, true);
1015   return serializeResponse(&prot, ctx, result);
1016 }
1017 
1018 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_concat_many(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1019 void SimpleServiceAsyncProcessor::throw_wrapped_concat_many(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1020   if (!ew) {
1021     return;
1022   }
1023   {
1024     (void)protoSeqId;
1025     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1026         ew, std::move(req), reqCtx, ctx, "concat_many");
1027     return;
1028   }
1029 }
1030 
1031 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_count_structs(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1032 void SimpleServiceAsyncProcessor::setUpAndProcess_count_structs(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1033   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1034     return;
1035   }
1036   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
1037   ctx->setRequestExecutionScope(std::move(scope));
1038   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_count_structs<ProtocolIn_, ProtocolOut_>, this);
1039 }
1040 
1041 template <typename ProtocolIn_, typename ProtocolOut_>
process_count_structs(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1042 void SimpleServiceAsyncProcessor::process_count_structs(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1043   if (!req->getShouldStartProcessing()) {
1044     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1045     return;
1046   }
1047   // make sure getRequestContext is null
1048   // so async calls don't accidentally use it
1049   iface_->setRequestContext(nullptr);
1050   SimpleService_count_structs_pargs args;
1051   auto uarg_items = std::make_unique<::std::vector<::py3::simple::SimpleStruct>>();
1052   args.get<0>().value = uarg_items.get();
1053   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.count_structs", ctx));
1054   try {
1055     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1056   }
1057   catch (const std::exception& ex) {
1058     folly::exception_wrapper ew(std::current_exception(), ex);
1059     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1060         ew, std::move(req), ctx, eb, "count_structs");
1061     return;
1062   }
1063   auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int32_t>>(std::move(req), std::move(ctxStack), return_count_structs<ProtocolIn_,ProtocolOut_>, throw_wrapped_count_structs<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1064   iface_->async_tm_count_structs(std::move(callback), std::move(uarg_items));
1065 }
1066 
1067 template <class ProtocolIn_, class ProtocolOut_>
return_count_structs(apache::thrift::ContextStack * ctx,::std::int32_t const & _return)1068 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_count_structs(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) {
1069   ProtocolOut_ prot;
1070   SimpleService_count_structs_presult result;
1071   result.get<0>().value = const_cast<::std::int32_t*>(&_return);
1072   result.setIsSet(0, true);
1073   return serializeResponse(&prot, ctx, result);
1074 }
1075 
1076 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_count_structs(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1077 void SimpleServiceAsyncProcessor::throw_wrapped_count_structs(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1078   if (!ew) {
1079     return;
1080   }
1081   {
1082     (void)protoSeqId;
1083     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1084         ew, std::move(req), reqCtx, ctx, "count_structs");
1085     return;
1086   }
1087 }
1088 
1089 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_sum_set(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1090 void SimpleServiceAsyncProcessor::setUpAndProcess_sum_set(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1091   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1092     return;
1093   }
1094   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
1095   ctx->setRequestExecutionScope(std::move(scope));
1096   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_sum_set<ProtocolIn_, ProtocolOut_>, this);
1097 }
1098 
1099 template <typename ProtocolIn_, typename ProtocolOut_>
process_sum_set(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1100 void SimpleServiceAsyncProcessor::process_sum_set(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1101   if (!req->getShouldStartProcessing()) {
1102     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1103     return;
1104   }
1105   // make sure getRequestContext is null
1106   // so async calls don't accidentally use it
1107   iface_->setRequestContext(nullptr);
1108   SimpleService_sum_set_pargs args;
1109   auto uarg_numbers = std::make_unique<::std::set<::std::int32_t>>();
1110   args.get<0>().value = uarg_numbers.get();
1111   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.sum_set", ctx));
1112   try {
1113     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1114   }
1115   catch (const std::exception& ex) {
1116     folly::exception_wrapper ew(std::current_exception(), ex);
1117     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1118         ew, std::move(req), ctx, eb, "sum_set");
1119     return;
1120   }
1121   auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int32_t>>(std::move(req), std::move(ctxStack), return_sum_set<ProtocolIn_,ProtocolOut_>, throw_wrapped_sum_set<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1122   iface_->async_tm_sum_set(std::move(callback), std::move(uarg_numbers));
1123 }
1124 
1125 template <class ProtocolIn_, class ProtocolOut_>
return_sum_set(apache::thrift::ContextStack * ctx,::std::int32_t const & _return)1126 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_sum_set(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) {
1127   ProtocolOut_ prot;
1128   SimpleService_sum_set_presult result;
1129   result.get<0>().value = const_cast<::std::int32_t*>(&_return);
1130   result.setIsSet(0, true);
1131   return serializeResponse(&prot, ctx, result);
1132 }
1133 
1134 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_sum_set(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1135 void SimpleServiceAsyncProcessor::throw_wrapped_sum_set(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1136   if (!ew) {
1137     return;
1138   }
1139   {
1140     (void)protoSeqId;
1141     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1142         ew, std::move(req), reqCtx, ctx, "sum_set");
1143     return;
1144   }
1145 }
1146 
1147 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_contains_word(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1148 void SimpleServiceAsyncProcessor::setUpAndProcess_contains_word(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1149   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1150     return;
1151   }
1152   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
1153   ctx->setRequestExecutionScope(std::move(scope));
1154   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_contains_word<ProtocolIn_, ProtocolOut_>, this);
1155 }
1156 
1157 template <typename ProtocolIn_, typename ProtocolOut_>
process_contains_word(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1158 void SimpleServiceAsyncProcessor::process_contains_word(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1159   if (!req->getShouldStartProcessing()) {
1160     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1161     return;
1162   }
1163   // make sure getRequestContext is null
1164   // so async calls don't accidentally use it
1165   iface_->setRequestContext(nullptr);
1166   SimpleService_contains_word_pargs args;
1167   auto uarg_words = std::make_unique<::std::set<::std::string>>();
1168   args.get<0>().value = uarg_words.get();
1169   auto uarg_word = std::make_unique<::std::string>();
1170   args.get<1>().value = uarg_word.get();
1171   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.contains_word", ctx));
1172   try {
1173     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1174   }
1175   catch (const std::exception& ex) {
1176     folly::exception_wrapper ew(std::current_exception(), ex);
1177     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1178         ew, std::move(req), ctx, eb, "contains_word");
1179     return;
1180   }
1181   auto callback = std::make_unique<apache::thrift::HandlerCallback<bool>>(std::move(req), std::move(ctxStack), return_contains_word<ProtocolIn_,ProtocolOut_>, throw_wrapped_contains_word<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1182   iface_->async_tm_contains_word(std::move(callback), std::move(uarg_words), std::move(uarg_word));
1183 }
1184 
1185 template <class ProtocolIn_, class ProtocolOut_>
return_contains_word(apache::thrift::ContextStack * ctx,bool const & _return)1186 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_contains_word(apache::thrift::ContextStack* ctx, bool const& _return) {
1187   ProtocolOut_ prot;
1188   SimpleService_contains_word_presult result;
1189   result.get<0>().value = const_cast<bool*>(&_return);
1190   result.setIsSet(0, true);
1191   return serializeResponse(&prot, ctx, result);
1192 }
1193 
1194 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_contains_word(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1195 void SimpleServiceAsyncProcessor::throw_wrapped_contains_word(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1196   if (!ew) {
1197     return;
1198   }
1199   {
1200     (void)protoSeqId;
1201     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1202         ew, std::move(req), reqCtx, ctx, "contains_word");
1203     return;
1204   }
1205 }
1206 
1207 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_get_map_value(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1208 void SimpleServiceAsyncProcessor::setUpAndProcess_get_map_value(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1209   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1210     return;
1211   }
1212   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
1213   ctx->setRequestExecutionScope(std::move(scope));
1214   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_get_map_value<ProtocolIn_, ProtocolOut_>, this);
1215 }
1216 
1217 template <typename ProtocolIn_, typename ProtocolOut_>
process_get_map_value(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1218 void SimpleServiceAsyncProcessor::process_get_map_value(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1219   if (!req->getShouldStartProcessing()) {
1220     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1221     return;
1222   }
1223   // make sure getRequestContext is null
1224   // so async calls don't accidentally use it
1225   iface_->setRequestContext(nullptr);
1226   SimpleService_get_map_value_pargs args;
1227   auto uarg_words = std::make_unique<::std::map<::std::string, ::std::string>>();
1228   args.get<0>().value = uarg_words.get();
1229   auto uarg_key = std::make_unique<::std::string>();
1230   args.get<1>().value = uarg_key.get();
1231   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.get_map_value", ctx));
1232   try {
1233     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1234   }
1235   catch (const std::exception& ex) {
1236     folly::exception_wrapper ew(std::current_exception(), ex);
1237     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1238         ew, std::move(req), ctx, eb, "get_map_value");
1239     return;
1240   }
1241   auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::string>>>(std::move(req), std::move(ctxStack), return_get_map_value<ProtocolIn_,ProtocolOut_>, throw_wrapped_get_map_value<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1242   iface_->async_tm_get_map_value(std::move(callback), std::move(uarg_words), std::move(uarg_key));
1243 }
1244 
1245 template <class ProtocolIn_, class ProtocolOut_>
return_get_map_value(apache::thrift::ContextStack * ctx,::std::string const & _return)1246 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_get_map_value(apache::thrift::ContextStack* ctx, ::std::string const& _return) {
1247   ProtocolOut_ prot;
1248   SimpleService_get_map_value_presult result;
1249   result.get<0>().value = const_cast<::std::string*>(&_return);
1250   result.setIsSet(0, true);
1251   return serializeResponse(&prot, ctx, result);
1252 }
1253 
1254 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_get_map_value(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1255 void SimpleServiceAsyncProcessor::throw_wrapped_get_map_value(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1256   if (!ew) {
1257     return;
1258   }
1259   {
1260     (void)protoSeqId;
1261     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1262         ew, std::move(req), reqCtx, ctx, "get_map_value");
1263     return;
1264   }
1265 }
1266 
1267 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_map_length(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1268 void SimpleServiceAsyncProcessor::setUpAndProcess_map_length(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1269   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1270     return;
1271   }
1272   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
1273   ctx->setRequestExecutionScope(std::move(scope));
1274   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_map_length<ProtocolIn_, ProtocolOut_>, this);
1275 }
1276 
1277 template <typename ProtocolIn_, typename ProtocolOut_>
process_map_length(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1278 void SimpleServiceAsyncProcessor::process_map_length(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1279   if (!req->getShouldStartProcessing()) {
1280     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1281     return;
1282   }
1283   // make sure getRequestContext is null
1284   // so async calls don't accidentally use it
1285   iface_->setRequestContext(nullptr);
1286   SimpleService_map_length_pargs args;
1287   auto uarg_items = std::make_unique<::std::map<::std::string, ::py3::simple::SimpleStruct>>();
1288   args.get<0>().value = uarg_items.get();
1289   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.map_length", ctx));
1290   try {
1291     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1292   }
1293   catch (const std::exception& ex) {
1294     folly::exception_wrapper ew(std::current_exception(), ex);
1295     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1296         ew, std::move(req), ctx, eb, "map_length");
1297     return;
1298   }
1299   auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int16_t>>(std::move(req), std::move(ctxStack), return_map_length<ProtocolIn_,ProtocolOut_>, throw_wrapped_map_length<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1300   iface_->async_tm_map_length(std::move(callback), std::move(uarg_items));
1301 }
1302 
1303 template <class ProtocolIn_, class ProtocolOut_>
return_map_length(apache::thrift::ContextStack * ctx,::std::int16_t const & _return)1304 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_map_length(apache::thrift::ContextStack* ctx, ::std::int16_t const& _return) {
1305   ProtocolOut_ prot;
1306   SimpleService_map_length_presult result;
1307   result.get<0>().value = const_cast<::std::int16_t*>(&_return);
1308   result.setIsSet(0, true);
1309   return serializeResponse(&prot, ctx, result);
1310 }
1311 
1312 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_map_length(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1313 void SimpleServiceAsyncProcessor::throw_wrapped_map_length(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1314   if (!ew) {
1315     return;
1316   }
1317   {
1318     (void)protoSeqId;
1319     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1320         ew, std::move(req), reqCtx, ctx, "map_length");
1321     return;
1322   }
1323 }
1324 
1325 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_sum_map_values(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1326 void SimpleServiceAsyncProcessor::setUpAndProcess_sum_map_values(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1327   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1328     return;
1329   }
1330   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
1331   ctx->setRequestExecutionScope(std::move(scope));
1332   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_sum_map_values<ProtocolIn_, ProtocolOut_>, this);
1333 }
1334 
1335 template <typename ProtocolIn_, typename ProtocolOut_>
process_sum_map_values(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1336 void SimpleServiceAsyncProcessor::process_sum_map_values(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1337   if (!req->getShouldStartProcessing()) {
1338     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1339     return;
1340   }
1341   // make sure getRequestContext is null
1342   // so async calls don't accidentally use it
1343   iface_->setRequestContext(nullptr);
1344   SimpleService_sum_map_values_pargs args;
1345   auto uarg_items = std::make_unique<::std::map<::std::string, ::std::int16_t>>();
1346   args.get<0>().value = uarg_items.get();
1347   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.sum_map_values", ctx));
1348   try {
1349     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1350   }
1351   catch (const std::exception& ex) {
1352     folly::exception_wrapper ew(std::current_exception(), ex);
1353     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1354         ew, std::move(req), ctx, eb, "sum_map_values");
1355     return;
1356   }
1357   auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int16_t>>(std::move(req), std::move(ctxStack), return_sum_map_values<ProtocolIn_,ProtocolOut_>, throw_wrapped_sum_map_values<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1358   iface_->async_tm_sum_map_values(std::move(callback), std::move(uarg_items));
1359 }
1360 
1361 template <class ProtocolIn_, class ProtocolOut_>
return_sum_map_values(apache::thrift::ContextStack * ctx,::std::int16_t const & _return)1362 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_sum_map_values(apache::thrift::ContextStack* ctx, ::std::int16_t const& _return) {
1363   ProtocolOut_ prot;
1364   SimpleService_sum_map_values_presult result;
1365   result.get<0>().value = const_cast<::std::int16_t*>(&_return);
1366   result.setIsSet(0, true);
1367   return serializeResponse(&prot, ctx, result);
1368 }
1369 
1370 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_sum_map_values(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1371 void SimpleServiceAsyncProcessor::throw_wrapped_sum_map_values(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1372   if (!ew) {
1373     return;
1374   }
1375   {
1376     (void)protoSeqId;
1377     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1378         ew, std::move(req), reqCtx, ctx, "sum_map_values");
1379     return;
1380   }
1381 }
1382 
1383 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_complex_sum_i32(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1384 void SimpleServiceAsyncProcessor::setUpAndProcess_complex_sum_i32(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1385   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1386     return;
1387   }
1388   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
1389   ctx->setRequestExecutionScope(std::move(scope));
1390   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_complex_sum_i32<ProtocolIn_, ProtocolOut_>, this);
1391 }
1392 
1393 template <typename ProtocolIn_, typename ProtocolOut_>
process_complex_sum_i32(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1394 void SimpleServiceAsyncProcessor::process_complex_sum_i32(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1395   if (!req->getShouldStartProcessing()) {
1396     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1397     return;
1398   }
1399   // make sure getRequestContext is null
1400   // so async calls don't accidentally use it
1401   iface_->setRequestContext(nullptr);
1402   SimpleService_complex_sum_i32_pargs args;
1403   auto uarg_counter = std::make_unique<::py3::simple::ComplexStruct>();
1404   args.get<0>().value = uarg_counter.get();
1405   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.complex_sum_i32", ctx));
1406   try {
1407     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1408   }
1409   catch (const std::exception& ex) {
1410     folly::exception_wrapper ew(std::current_exception(), ex);
1411     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1412         ew, std::move(req), ctx, eb, "complex_sum_i32");
1413     return;
1414   }
1415   auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int32_t>>(std::move(req), std::move(ctxStack), return_complex_sum_i32<ProtocolIn_,ProtocolOut_>, throw_wrapped_complex_sum_i32<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1416   iface_->async_tm_complex_sum_i32(std::move(callback), std::move(uarg_counter));
1417 }
1418 
1419 template <class ProtocolIn_, class ProtocolOut_>
return_complex_sum_i32(apache::thrift::ContextStack * ctx,::std::int32_t const & _return)1420 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_complex_sum_i32(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) {
1421   ProtocolOut_ prot;
1422   SimpleService_complex_sum_i32_presult result;
1423   result.get<0>().value = const_cast<::std::int32_t*>(&_return);
1424   result.setIsSet(0, true);
1425   return serializeResponse(&prot, ctx, result);
1426 }
1427 
1428 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_complex_sum_i32(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1429 void SimpleServiceAsyncProcessor::throw_wrapped_complex_sum_i32(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1430   if (!ew) {
1431     return;
1432   }
1433   {
1434     (void)protoSeqId;
1435     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1436         ew, std::move(req), reqCtx, ctx, "complex_sum_i32");
1437     return;
1438   }
1439 }
1440 
1441 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_repeat_name(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1442 void SimpleServiceAsyncProcessor::setUpAndProcess_repeat_name(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1443   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1444     return;
1445   }
1446   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
1447   ctx->setRequestExecutionScope(std::move(scope));
1448   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_repeat_name<ProtocolIn_, ProtocolOut_>, this);
1449 }
1450 
1451 template <typename ProtocolIn_, typename ProtocolOut_>
process_repeat_name(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1452 void SimpleServiceAsyncProcessor::process_repeat_name(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1453   if (!req->getShouldStartProcessing()) {
1454     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1455     return;
1456   }
1457   // make sure getRequestContext is null
1458   // so async calls don't accidentally use it
1459   iface_->setRequestContext(nullptr);
1460   SimpleService_repeat_name_pargs args;
1461   auto uarg_counter = std::make_unique<::py3::simple::ComplexStruct>();
1462   args.get<0>().value = uarg_counter.get();
1463   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.repeat_name", ctx));
1464   try {
1465     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1466   }
1467   catch (const std::exception& ex) {
1468     folly::exception_wrapper ew(std::current_exception(), ex);
1469     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1470         ew, std::move(req), ctx, eb, "repeat_name");
1471     return;
1472   }
1473   auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::string>>>(std::move(req), std::move(ctxStack), return_repeat_name<ProtocolIn_,ProtocolOut_>, throw_wrapped_repeat_name<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1474   iface_->async_tm_repeat_name(std::move(callback), std::move(uarg_counter));
1475 }
1476 
1477 template <class ProtocolIn_, class ProtocolOut_>
return_repeat_name(apache::thrift::ContextStack * ctx,::std::string const & _return)1478 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_repeat_name(apache::thrift::ContextStack* ctx, ::std::string const& _return) {
1479   ProtocolOut_ prot;
1480   SimpleService_repeat_name_presult result;
1481   result.get<0>().value = const_cast<::std::string*>(&_return);
1482   result.setIsSet(0, true);
1483   return serializeResponse(&prot, ctx, result);
1484 }
1485 
1486 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_repeat_name(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1487 void SimpleServiceAsyncProcessor::throw_wrapped_repeat_name(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1488   if (!ew) {
1489     return;
1490   }
1491   {
1492     (void)protoSeqId;
1493     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1494         ew, std::move(req), reqCtx, ctx, "repeat_name");
1495     return;
1496   }
1497 }
1498 
1499 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_get_struct(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1500 void SimpleServiceAsyncProcessor::setUpAndProcess_get_struct(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1501   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1502     return;
1503   }
1504   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
1505   ctx->setRequestExecutionScope(std::move(scope));
1506   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_get_struct<ProtocolIn_, ProtocolOut_>, this);
1507 }
1508 
1509 template <typename ProtocolIn_, typename ProtocolOut_>
process_get_struct(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1510 void SimpleServiceAsyncProcessor::process_get_struct(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1511   if (!req->getShouldStartProcessing()) {
1512     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1513     return;
1514   }
1515   // make sure getRequestContext is null
1516   // so async calls don't accidentally use it
1517   iface_->setRequestContext(nullptr);
1518   SimpleService_get_struct_pargs args;
1519   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.get_struct", ctx));
1520   try {
1521     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1522   }
1523   catch (const std::exception& ex) {
1524     folly::exception_wrapper ew(std::current_exception(), ex);
1525     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1526         ew, std::move(req), ctx, eb, "get_struct");
1527     return;
1528   }
1529   auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::py3::simple::SimpleStruct>>>(std::move(req), std::move(ctxStack), return_get_struct<ProtocolIn_,ProtocolOut_>, throw_wrapped_get_struct<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1530   iface_->async_tm_get_struct(std::move(callback));
1531 }
1532 
1533 template <class ProtocolIn_, class ProtocolOut_>
return_get_struct(apache::thrift::ContextStack * ctx,::py3::simple::SimpleStruct const & _return)1534 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_get_struct(apache::thrift::ContextStack* ctx, ::py3::simple::SimpleStruct const& _return) {
1535   ProtocolOut_ prot;
1536   SimpleService_get_struct_presult result;
1537   result.get<0>().value = const_cast<::py3::simple::SimpleStruct*>(&_return);
1538   result.setIsSet(0, true);
1539   return serializeResponse(&prot, ctx, result);
1540 }
1541 
1542 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_get_struct(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1543 void SimpleServiceAsyncProcessor::throw_wrapped_get_struct(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1544   if (!ew) {
1545     return;
1546   }
1547   {
1548     (void)protoSeqId;
1549     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1550         ew, std::move(req), reqCtx, ctx, "get_struct");
1551     return;
1552   }
1553 }
1554 
1555 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_fib(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1556 void SimpleServiceAsyncProcessor::setUpAndProcess_fib(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1557   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1558     return;
1559   }
1560   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
1561   ctx->setRequestExecutionScope(std::move(scope));
1562   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_fib<ProtocolIn_, ProtocolOut_>, this);
1563 }
1564 
1565 template <typename ProtocolIn_, typename ProtocolOut_>
process_fib(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1566 void SimpleServiceAsyncProcessor::process_fib(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1567   if (!req->getShouldStartProcessing()) {
1568     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1569     return;
1570   }
1571   // make sure getRequestContext is null
1572   // so async calls don't accidentally use it
1573   iface_->setRequestContext(nullptr);
1574   SimpleService_fib_pargs args;
1575   ::std::int16_t uarg_n{0};
1576   args.get<0>().value = &uarg_n;
1577   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.fib", ctx));
1578   try {
1579     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1580   }
1581   catch (const std::exception& ex) {
1582     folly::exception_wrapper ew(std::current_exception(), ex);
1583     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1584         ew, std::move(req), ctx, eb, "fib");
1585     return;
1586   }
1587   auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::vector<::std::int32_t>>>>(std::move(req), std::move(ctxStack), return_fib<ProtocolIn_,ProtocolOut_>, throw_wrapped_fib<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1588   iface_->async_tm_fib(std::move(callback), args.get<0>().ref());
1589 }
1590 
1591 template <class ProtocolIn_, class ProtocolOut_>
return_fib(apache::thrift::ContextStack * ctx,::std::vector<::std::int32_t> const & _return)1592 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_fib(apache::thrift::ContextStack* ctx, ::std::vector<::std::int32_t> const& _return) {
1593   ProtocolOut_ prot;
1594   SimpleService_fib_presult result;
1595   result.get<0>().value = const_cast<::std::vector<::std::int32_t>*>(&_return);
1596   result.setIsSet(0, true);
1597   return serializeResponse(&prot, ctx, result);
1598 }
1599 
1600 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_fib(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1601 void SimpleServiceAsyncProcessor::throw_wrapped_fib(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1602   if (!ew) {
1603     return;
1604   }
1605   {
1606     (void)protoSeqId;
1607     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1608         ew, std::move(req), reqCtx, ctx, "fib");
1609     return;
1610   }
1611 }
1612 
1613 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_unique_words(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1614 void SimpleServiceAsyncProcessor::setUpAndProcess_unique_words(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1615   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1616     return;
1617   }
1618   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
1619   ctx->setRequestExecutionScope(std::move(scope));
1620   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_unique_words<ProtocolIn_, ProtocolOut_>, this);
1621 }
1622 
1623 template <typename ProtocolIn_, typename ProtocolOut_>
process_unique_words(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1624 void SimpleServiceAsyncProcessor::process_unique_words(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1625   if (!req->getShouldStartProcessing()) {
1626     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1627     return;
1628   }
1629   // make sure getRequestContext is null
1630   // so async calls don't accidentally use it
1631   iface_->setRequestContext(nullptr);
1632   SimpleService_unique_words_pargs args;
1633   auto uarg_words = std::make_unique<::std::vector<::std::string>>();
1634   args.get<0>().value = uarg_words.get();
1635   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.unique_words", ctx));
1636   try {
1637     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1638   }
1639   catch (const std::exception& ex) {
1640     folly::exception_wrapper ew(std::current_exception(), ex);
1641     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1642         ew, std::move(req), ctx, eb, "unique_words");
1643     return;
1644   }
1645   auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::set<::std::string>>>>(std::move(req), std::move(ctxStack), return_unique_words<ProtocolIn_,ProtocolOut_>, throw_wrapped_unique_words<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1646   iface_->async_tm_unique_words(std::move(callback), std::move(uarg_words));
1647 }
1648 
1649 template <class ProtocolIn_, class ProtocolOut_>
return_unique_words(apache::thrift::ContextStack * ctx,::std::set<::std::string> const & _return)1650 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_unique_words(apache::thrift::ContextStack* ctx, ::std::set<::std::string> const& _return) {
1651   ProtocolOut_ prot;
1652   SimpleService_unique_words_presult result;
1653   result.get<0>().value = const_cast<::std::set<::std::string>*>(&_return);
1654   result.setIsSet(0, true);
1655   return serializeResponse(&prot, ctx, result);
1656 }
1657 
1658 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_unique_words(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1659 void SimpleServiceAsyncProcessor::throw_wrapped_unique_words(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1660   if (!ew) {
1661     return;
1662   }
1663   {
1664     (void)protoSeqId;
1665     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1666         ew, std::move(req), reqCtx, ctx, "unique_words");
1667     return;
1668   }
1669 }
1670 
1671 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_words_count(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1672 void SimpleServiceAsyncProcessor::setUpAndProcess_words_count(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1673   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1674     return;
1675   }
1676   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
1677   ctx->setRequestExecutionScope(std::move(scope));
1678   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_words_count<ProtocolIn_, ProtocolOut_>, this);
1679 }
1680 
1681 template <typename ProtocolIn_, typename ProtocolOut_>
process_words_count(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1682 void SimpleServiceAsyncProcessor::process_words_count(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1683   if (!req->getShouldStartProcessing()) {
1684     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1685     return;
1686   }
1687   // make sure getRequestContext is null
1688   // so async calls don't accidentally use it
1689   iface_->setRequestContext(nullptr);
1690   SimpleService_words_count_pargs args;
1691   auto uarg_words = std::make_unique<::std::vector<::std::string>>();
1692   args.get<0>().value = uarg_words.get();
1693   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.words_count", ctx));
1694   try {
1695     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1696   }
1697   catch (const std::exception& ex) {
1698     folly::exception_wrapper ew(std::current_exception(), ex);
1699     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1700         ew, std::move(req), ctx, eb, "words_count");
1701     return;
1702   }
1703   auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::map<::std::string, ::std::int16_t>>>>(std::move(req), std::move(ctxStack), return_words_count<ProtocolIn_,ProtocolOut_>, throw_wrapped_words_count<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1704   iface_->async_tm_words_count(std::move(callback), std::move(uarg_words));
1705 }
1706 
1707 template <class ProtocolIn_, class ProtocolOut_>
return_words_count(apache::thrift::ContextStack * ctx,::std::map<::std::string,::std::int16_t> const & _return)1708 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_words_count(apache::thrift::ContextStack* ctx, ::std::map<::std::string, ::std::int16_t> const& _return) {
1709   ProtocolOut_ prot;
1710   SimpleService_words_count_presult result;
1711   result.get<0>().value = const_cast<::std::map<::std::string, ::std::int16_t>*>(&_return);
1712   result.setIsSet(0, true);
1713   return serializeResponse(&prot, ctx, result);
1714 }
1715 
1716 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_words_count(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1717 void SimpleServiceAsyncProcessor::throw_wrapped_words_count(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1718   if (!ew) {
1719     return;
1720   }
1721   {
1722     (void)protoSeqId;
1723     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1724         ew, std::move(req), reqCtx, ctx, "words_count");
1725     return;
1726   }
1727 }
1728 
1729 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_set_enum(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1730 void SimpleServiceAsyncProcessor::setUpAndProcess_set_enum(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1731   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1732     return;
1733   }
1734   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
1735   ctx->setRequestExecutionScope(std::move(scope));
1736   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_set_enum<ProtocolIn_, ProtocolOut_>, this);
1737 }
1738 
1739 template <typename ProtocolIn_, typename ProtocolOut_>
process_set_enum(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1740 void SimpleServiceAsyncProcessor::process_set_enum(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1741   if (!req->getShouldStartProcessing()) {
1742     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1743     return;
1744   }
1745   // make sure getRequestContext is null
1746   // so async calls don't accidentally use it
1747   iface_->setRequestContext(nullptr);
1748   SimpleService_set_enum_pargs args;
1749   ::py3::simple::AnEnum uarg_in_enum{static_cast<::py3::simple::AnEnum>(0)};
1750   args.get<0>().value = &uarg_in_enum;
1751   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.set_enum", ctx));
1752   try {
1753     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1754   }
1755   catch (const std::exception& ex) {
1756     folly::exception_wrapper ew(std::current_exception(), ex);
1757     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1758         ew, std::move(req), ctx, eb, "set_enum");
1759     return;
1760   }
1761   auto callback = std::make_unique<apache::thrift::HandlerCallback<::py3::simple::AnEnum>>(std::move(req), std::move(ctxStack), return_set_enum<ProtocolIn_,ProtocolOut_>, throw_wrapped_set_enum<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1762   iface_->async_tm_set_enum(std::move(callback), args.get<0>().ref());
1763 }
1764 
1765 template <class ProtocolIn_, class ProtocolOut_>
return_set_enum(apache::thrift::ContextStack * ctx,::py3::simple::AnEnum const & _return)1766 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_set_enum(apache::thrift::ContextStack* ctx, ::py3::simple::AnEnum const& _return) {
1767   ProtocolOut_ prot;
1768   SimpleService_set_enum_presult result;
1769   result.get<0>().value = const_cast<::py3::simple::AnEnum*>(&_return);
1770   result.setIsSet(0, true);
1771   return serializeResponse(&prot, ctx, result);
1772 }
1773 
1774 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_set_enum(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1775 void SimpleServiceAsyncProcessor::throw_wrapped_set_enum(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1776   if (!ew) {
1777     return;
1778   }
1779   {
1780     (void)protoSeqId;
1781     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1782         ew, std::move(req), reqCtx, ctx, "set_enum");
1783     return;
1784   }
1785 }
1786 
1787 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_list_of_lists(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1788 void SimpleServiceAsyncProcessor::setUpAndProcess_list_of_lists(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1789   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1790     return;
1791   }
1792   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
1793   ctx->setRequestExecutionScope(std::move(scope));
1794   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_list_of_lists<ProtocolIn_, ProtocolOut_>, this);
1795 }
1796 
1797 template <typename ProtocolIn_, typename ProtocolOut_>
process_list_of_lists(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1798 void SimpleServiceAsyncProcessor::process_list_of_lists(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1799   if (!req->getShouldStartProcessing()) {
1800     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1801     return;
1802   }
1803   // make sure getRequestContext is null
1804   // so async calls don't accidentally use it
1805   iface_->setRequestContext(nullptr);
1806   SimpleService_list_of_lists_pargs args;
1807   ::std::int16_t uarg_num_lists{0};
1808   args.get<0>().value = &uarg_num_lists;
1809   ::std::int16_t uarg_num_items{0};
1810   args.get<1>().value = &uarg_num_items;
1811   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.list_of_lists", ctx));
1812   try {
1813     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1814   }
1815   catch (const std::exception& ex) {
1816     folly::exception_wrapper ew(std::current_exception(), ex);
1817     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1818         ew, std::move(req), ctx, eb, "list_of_lists");
1819     return;
1820   }
1821   auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::vector<::std::vector<::std::int32_t>>>>>(std::move(req), std::move(ctxStack), return_list_of_lists<ProtocolIn_,ProtocolOut_>, throw_wrapped_list_of_lists<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1822   iface_->async_tm_list_of_lists(std::move(callback), args.get<0>().ref(), args.get<1>().ref());
1823 }
1824 
1825 template <class ProtocolIn_, class ProtocolOut_>
return_list_of_lists(apache::thrift::ContextStack * ctx,::std::vector<::std::vector<::std::int32_t>> const & _return)1826 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_list_of_lists(apache::thrift::ContextStack* ctx, ::std::vector<::std::vector<::std::int32_t>> const& _return) {
1827   ProtocolOut_ prot;
1828   SimpleService_list_of_lists_presult result;
1829   result.get<0>().value = const_cast<::std::vector<::std::vector<::std::int32_t>>*>(&_return);
1830   result.setIsSet(0, true);
1831   return serializeResponse(&prot, ctx, result);
1832 }
1833 
1834 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_list_of_lists(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1835 void SimpleServiceAsyncProcessor::throw_wrapped_list_of_lists(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1836   if (!ew) {
1837     return;
1838   }
1839   {
1840     (void)protoSeqId;
1841     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1842         ew, std::move(req), reqCtx, ctx, "list_of_lists");
1843     return;
1844   }
1845 }
1846 
1847 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_word_character_frequency(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1848 void SimpleServiceAsyncProcessor::setUpAndProcess_word_character_frequency(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1849   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1850     return;
1851   }
1852   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
1853   ctx->setRequestExecutionScope(std::move(scope));
1854   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_word_character_frequency<ProtocolIn_, ProtocolOut_>, this);
1855 }
1856 
1857 template <typename ProtocolIn_, typename ProtocolOut_>
process_word_character_frequency(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1858 void SimpleServiceAsyncProcessor::process_word_character_frequency(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1859   if (!req->getShouldStartProcessing()) {
1860     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1861     return;
1862   }
1863   // make sure getRequestContext is null
1864   // so async calls don't accidentally use it
1865   iface_->setRequestContext(nullptr);
1866   SimpleService_word_character_frequency_pargs args;
1867   auto uarg_sentence = std::make_unique<::std::string>();
1868   args.get<0>().value = uarg_sentence.get();
1869   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.word_character_frequency", ctx));
1870   try {
1871     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1872   }
1873   catch (const std::exception& ex) {
1874     folly::exception_wrapper ew(std::current_exception(), ex);
1875     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1876         ew, std::move(req), ctx, eb, "word_character_frequency");
1877     return;
1878   }
1879   auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::map<::std::string, ::std::map<::std::string, ::std::int32_t>>>>>(std::move(req), std::move(ctxStack), return_word_character_frequency<ProtocolIn_,ProtocolOut_>, throw_wrapped_word_character_frequency<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1880   iface_->async_tm_word_character_frequency(std::move(callback), std::move(uarg_sentence));
1881 }
1882 
1883 template <class ProtocolIn_, class ProtocolOut_>
return_word_character_frequency(apache::thrift::ContextStack * ctx,::std::map<::std::string,::std::map<::std::string,::std::int32_t>> const & _return)1884 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) {
1885   ProtocolOut_ prot;
1886   SimpleService_word_character_frequency_presult result;
1887   result.get<0>().value = const_cast<::std::map<::std::string, ::std::map<::std::string, ::std::int32_t>>*>(&_return);
1888   result.setIsSet(0, true);
1889   return serializeResponse(&prot, ctx, result);
1890 }
1891 
1892 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_word_character_frequency(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1893 void SimpleServiceAsyncProcessor::throw_wrapped_word_character_frequency(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1894   if (!ew) {
1895     return;
1896   }
1897   {
1898     (void)protoSeqId;
1899     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1900         ew, std::move(req), reqCtx, ctx, "word_character_frequency");
1901     return;
1902   }
1903 }
1904 
1905 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_list_of_sets(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1906 void SimpleServiceAsyncProcessor::setUpAndProcess_list_of_sets(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1907   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1908     return;
1909   }
1910   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
1911   ctx->setRequestExecutionScope(std::move(scope));
1912   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_list_of_sets<ProtocolIn_, ProtocolOut_>, this);
1913 }
1914 
1915 template <typename ProtocolIn_, typename ProtocolOut_>
process_list_of_sets(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1916 void SimpleServiceAsyncProcessor::process_list_of_sets(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1917   if (!req->getShouldStartProcessing()) {
1918     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1919     return;
1920   }
1921   // make sure getRequestContext is null
1922   // so async calls don't accidentally use it
1923   iface_->setRequestContext(nullptr);
1924   SimpleService_list_of_sets_pargs args;
1925   auto uarg_some_words = std::make_unique<::std::string>();
1926   args.get<0>().value = uarg_some_words.get();
1927   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.list_of_sets", ctx));
1928   try {
1929     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1930   }
1931   catch (const std::exception& ex) {
1932     folly::exception_wrapper ew(std::current_exception(), ex);
1933     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1934         ew, std::move(req), ctx, eb, "list_of_sets");
1935     return;
1936   }
1937   auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::vector<::std::set<::std::string>>>>>(std::move(req), std::move(ctxStack), return_list_of_sets<ProtocolIn_,ProtocolOut_>, throw_wrapped_list_of_sets<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1938   iface_->async_tm_list_of_sets(std::move(callback), std::move(uarg_some_words));
1939 }
1940 
1941 template <class ProtocolIn_, class ProtocolOut_>
return_list_of_sets(apache::thrift::ContextStack * ctx,::std::vector<::std::set<::std::string>> const & _return)1942 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_list_of_sets(apache::thrift::ContextStack* ctx, ::std::vector<::std::set<::std::string>> const& _return) {
1943   ProtocolOut_ prot;
1944   SimpleService_list_of_sets_presult result;
1945   result.get<0>().value = const_cast<::std::vector<::std::set<::std::string>>*>(&_return);
1946   result.setIsSet(0, true);
1947   return serializeResponse(&prot, ctx, result);
1948 }
1949 
1950 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_list_of_sets(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1951 void SimpleServiceAsyncProcessor::throw_wrapped_list_of_sets(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1952   if (!ew) {
1953     return;
1954   }
1955   {
1956     (void)protoSeqId;
1957     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1958         ew, std::move(req), reqCtx, ctx, "list_of_sets");
1959     return;
1960   }
1961 }
1962 
1963 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_nested_map_argument(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1964 void SimpleServiceAsyncProcessor::setUpAndProcess_nested_map_argument(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1965   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1966     return;
1967   }
1968   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
1969   ctx->setRequestExecutionScope(std::move(scope));
1970   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_nested_map_argument<ProtocolIn_, ProtocolOut_>, this);
1971 }
1972 
1973 template <typename ProtocolIn_, typename ProtocolOut_>
process_nested_map_argument(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1974 void SimpleServiceAsyncProcessor::process_nested_map_argument(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1975   if (!req->getShouldStartProcessing()) {
1976     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1977     return;
1978   }
1979   // make sure getRequestContext is null
1980   // so async calls don't accidentally use it
1981   iface_->setRequestContext(nullptr);
1982   SimpleService_nested_map_argument_pargs args;
1983   auto uarg_struct_map = std::make_unique<::std::map<::std::string, ::std::vector<::py3::simple::SimpleStruct>>>();
1984   args.get<0>().value = uarg_struct_map.get();
1985   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.nested_map_argument", ctx));
1986   try {
1987     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1988   }
1989   catch (const std::exception& ex) {
1990     folly::exception_wrapper ew(std::current_exception(), ex);
1991     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1992         ew, std::move(req), ctx, eb, "nested_map_argument");
1993     return;
1994   }
1995   auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int32_t>>(std::move(req), std::move(ctxStack), return_nested_map_argument<ProtocolIn_,ProtocolOut_>, throw_wrapped_nested_map_argument<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1996   iface_->async_tm_nested_map_argument(std::move(callback), std::move(uarg_struct_map));
1997 }
1998 
1999 template <class ProtocolIn_, class ProtocolOut_>
return_nested_map_argument(apache::thrift::ContextStack * ctx,::std::int32_t const & _return)2000 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_nested_map_argument(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) {
2001   ProtocolOut_ prot;
2002   SimpleService_nested_map_argument_presult result;
2003   result.get<0>().value = const_cast<::std::int32_t*>(&_return);
2004   result.setIsSet(0, true);
2005   return serializeResponse(&prot, ctx, result);
2006 }
2007 
2008 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_nested_map_argument(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)2009 void SimpleServiceAsyncProcessor::throw_wrapped_nested_map_argument(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
2010   if (!ew) {
2011     return;
2012   }
2013   {
2014     (void)protoSeqId;
2015     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
2016         ew, std::move(req), reqCtx, ctx, "nested_map_argument");
2017     return;
2018   }
2019 }
2020 
2021 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_make_sentence(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)2022 void SimpleServiceAsyncProcessor::setUpAndProcess_make_sentence(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
2023   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
2024     return;
2025   }
2026   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
2027   ctx->setRequestExecutionScope(std::move(scope));
2028   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_make_sentence<ProtocolIn_, ProtocolOut_>, this);
2029 }
2030 
2031 template <typename ProtocolIn_, typename ProtocolOut_>
process_make_sentence(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)2032 void SimpleServiceAsyncProcessor::process_make_sentence(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
2033   if (!req->getShouldStartProcessing()) {
2034     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
2035     return;
2036   }
2037   // make sure getRequestContext is null
2038   // so async calls don't accidentally use it
2039   iface_->setRequestContext(nullptr);
2040   SimpleService_make_sentence_pargs args;
2041   auto uarg_word_chars = std::make_unique<::std::vector<::std::vector<::std::string>>>();
2042   args.get<0>().value = uarg_word_chars.get();
2043   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.make_sentence", ctx));
2044   try {
2045     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
2046   }
2047   catch (const std::exception& ex) {
2048     folly::exception_wrapper ew(std::current_exception(), ex);
2049     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
2050         ew, std::move(req), ctx, eb, "make_sentence");
2051     return;
2052   }
2053   auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::string>>>(std::move(req), std::move(ctxStack), return_make_sentence<ProtocolIn_,ProtocolOut_>, throw_wrapped_make_sentence<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
2054   iface_->async_tm_make_sentence(std::move(callback), std::move(uarg_word_chars));
2055 }
2056 
2057 template <class ProtocolIn_, class ProtocolOut_>
return_make_sentence(apache::thrift::ContextStack * ctx,::std::string const & _return)2058 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_make_sentence(apache::thrift::ContextStack* ctx, ::std::string const& _return) {
2059   ProtocolOut_ prot;
2060   SimpleService_make_sentence_presult result;
2061   result.get<0>().value = const_cast<::std::string*>(&_return);
2062   result.setIsSet(0, true);
2063   return serializeResponse(&prot, ctx, result);
2064 }
2065 
2066 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_make_sentence(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)2067 void SimpleServiceAsyncProcessor::throw_wrapped_make_sentence(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
2068   if (!ew) {
2069     return;
2070   }
2071   {
2072     (void)protoSeqId;
2073     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
2074         ew, std::move(req), reqCtx, ctx, "make_sentence");
2075     return;
2076   }
2077 }
2078 
2079 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_get_union(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)2080 void SimpleServiceAsyncProcessor::setUpAndProcess_get_union(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
2081   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
2082     return;
2083   }
2084   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
2085   ctx->setRequestExecutionScope(std::move(scope));
2086   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_get_union<ProtocolIn_, ProtocolOut_>, this);
2087 }
2088 
2089 template <typename ProtocolIn_, typename ProtocolOut_>
process_get_union(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)2090 void SimpleServiceAsyncProcessor::process_get_union(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
2091   if (!req->getShouldStartProcessing()) {
2092     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
2093     return;
2094   }
2095   // make sure getRequestContext is null
2096   // so async calls don't accidentally use it
2097   iface_->setRequestContext(nullptr);
2098   SimpleService_get_union_pargs args;
2099   auto uarg_sets = std::make_unique<::std::vector<::std::set<::std::int32_t>>>();
2100   args.get<0>().value = uarg_sets.get();
2101   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.get_union", ctx));
2102   try {
2103     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
2104   }
2105   catch (const std::exception& ex) {
2106     folly::exception_wrapper ew(std::current_exception(), ex);
2107     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
2108         ew, std::move(req), ctx, eb, "get_union");
2109     return;
2110   }
2111   auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::set<::std::int32_t>>>>(std::move(req), std::move(ctxStack), return_get_union<ProtocolIn_,ProtocolOut_>, throw_wrapped_get_union<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
2112   iface_->async_tm_get_union(std::move(callback), std::move(uarg_sets));
2113 }
2114 
2115 template <class ProtocolIn_, class ProtocolOut_>
return_get_union(apache::thrift::ContextStack * ctx,::std::set<::std::int32_t> const & _return)2116 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_get_union(apache::thrift::ContextStack* ctx, ::std::set<::std::int32_t> const& _return) {
2117   ProtocolOut_ prot;
2118   SimpleService_get_union_presult result;
2119   result.get<0>().value = const_cast<::std::set<::std::int32_t>*>(&_return);
2120   result.setIsSet(0, true);
2121   return serializeResponse(&prot, ctx, result);
2122 }
2123 
2124 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_get_union(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)2125 void SimpleServiceAsyncProcessor::throw_wrapped_get_union(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
2126   if (!ew) {
2127     return;
2128   }
2129   {
2130     (void)protoSeqId;
2131     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
2132         ew, std::move(req), reqCtx, ctx, "get_union");
2133     return;
2134   }
2135 }
2136 
2137 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_get_keys(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)2138 void SimpleServiceAsyncProcessor::setUpAndProcess_get_keys(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
2139   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
2140     return;
2141   }
2142   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
2143   ctx->setRequestExecutionScope(std::move(scope));
2144   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_get_keys<ProtocolIn_, ProtocolOut_>, this);
2145 }
2146 
2147 template <typename ProtocolIn_, typename ProtocolOut_>
process_get_keys(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)2148 void SimpleServiceAsyncProcessor::process_get_keys(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
2149   if (!req->getShouldStartProcessing()) {
2150     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
2151     return;
2152   }
2153   // make sure getRequestContext is null
2154   // so async calls don't accidentally use it
2155   iface_->setRequestContext(nullptr);
2156   SimpleService_get_keys_pargs args;
2157   auto uarg_string_map = std::make_unique<::std::vector<::std::map<::std::string, ::std::string>>>();
2158   args.get<0>().value = uarg_string_map.get();
2159   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.get_keys", ctx));
2160   try {
2161     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
2162   }
2163   catch (const std::exception& ex) {
2164     folly::exception_wrapper ew(std::current_exception(), ex);
2165     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
2166         ew, std::move(req), ctx, eb, "get_keys");
2167     return;
2168   }
2169   auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::set<::std::string>>>>(std::move(req), std::move(ctxStack), return_get_keys<ProtocolIn_,ProtocolOut_>, throw_wrapped_get_keys<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
2170   iface_->async_tm_get_keys(std::move(callback), std::move(uarg_string_map));
2171 }
2172 
2173 template <class ProtocolIn_, class ProtocolOut_>
return_get_keys(apache::thrift::ContextStack * ctx,::std::set<::std::string> const & _return)2174 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_get_keys(apache::thrift::ContextStack* ctx, ::std::set<::std::string> const& _return) {
2175   ProtocolOut_ prot;
2176   SimpleService_get_keys_presult result;
2177   result.get<0>().value = const_cast<::std::set<::std::string>*>(&_return);
2178   result.setIsSet(0, true);
2179   return serializeResponse(&prot, ctx, result);
2180 }
2181 
2182 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_get_keys(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)2183 void SimpleServiceAsyncProcessor::throw_wrapped_get_keys(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
2184   if (!ew) {
2185     return;
2186   }
2187   {
2188     (void)protoSeqId;
2189     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
2190         ew, std::move(req), reqCtx, ctx, "get_keys");
2191     return;
2192   }
2193 }
2194 
2195 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_lookup_double(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)2196 void SimpleServiceAsyncProcessor::setUpAndProcess_lookup_double(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
2197   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
2198     return;
2199   }
2200   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
2201   ctx->setRequestExecutionScope(std::move(scope));
2202   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_lookup_double<ProtocolIn_, ProtocolOut_>, this);
2203 }
2204 
2205 template <typename ProtocolIn_, typename ProtocolOut_>
process_lookup_double(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)2206 void SimpleServiceAsyncProcessor::process_lookup_double(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
2207   if (!req->getShouldStartProcessing()) {
2208     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
2209     return;
2210   }
2211   // make sure getRequestContext is null
2212   // so async calls don't accidentally use it
2213   iface_->setRequestContext(nullptr);
2214   SimpleService_lookup_double_pargs args;
2215   ::std::int32_t uarg_key{0};
2216   args.get<0>().value = &uarg_key;
2217   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.lookup_double", ctx));
2218   try {
2219     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
2220   }
2221   catch (const std::exception& ex) {
2222     folly::exception_wrapper ew(std::current_exception(), ex);
2223     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
2224         ew, std::move(req), ctx, eb, "lookup_double");
2225     return;
2226   }
2227   auto callback = std::make_unique<apache::thrift::HandlerCallback<double>>(std::move(req), std::move(ctxStack), return_lookup_double<ProtocolIn_,ProtocolOut_>, throw_wrapped_lookup_double<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
2228   iface_->async_tm_lookup_double(std::move(callback), args.get<0>().ref());
2229 }
2230 
2231 template <class ProtocolIn_, class ProtocolOut_>
return_lookup_double(apache::thrift::ContextStack * ctx,double const & _return)2232 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_lookup_double(apache::thrift::ContextStack* ctx, double const& _return) {
2233   ProtocolOut_ prot;
2234   SimpleService_lookup_double_presult result;
2235   result.get<0>().value = const_cast<double*>(&_return);
2236   result.setIsSet(0, true);
2237   return serializeResponse(&prot, ctx, result);
2238 }
2239 
2240 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_lookup_double(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)2241 void SimpleServiceAsyncProcessor::throw_wrapped_lookup_double(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
2242   if (!ew) {
2243     return;
2244   }
2245   {
2246     (void)protoSeqId;
2247     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
2248         ew, std::move(req), reqCtx, ctx, "lookup_double");
2249     return;
2250   }
2251 }
2252 
2253 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_retrieve_binary(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)2254 void SimpleServiceAsyncProcessor::setUpAndProcess_retrieve_binary(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
2255   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
2256     return;
2257   }
2258   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
2259   ctx->setRequestExecutionScope(std::move(scope));
2260   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_retrieve_binary<ProtocolIn_, ProtocolOut_>, this);
2261 }
2262 
2263 template <typename ProtocolIn_, typename ProtocolOut_>
process_retrieve_binary(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)2264 void SimpleServiceAsyncProcessor::process_retrieve_binary(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
2265   if (!req->getShouldStartProcessing()) {
2266     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
2267     return;
2268   }
2269   // make sure getRequestContext is null
2270   // so async calls don't accidentally use it
2271   iface_->setRequestContext(nullptr);
2272   SimpleService_retrieve_binary_pargs args;
2273   auto uarg_something = std::make_unique<::std::string>();
2274   args.get<0>().value = uarg_something.get();
2275   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.retrieve_binary", ctx));
2276   try {
2277     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
2278   }
2279   catch (const std::exception& ex) {
2280     folly::exception_wrapper ew(std::current_exception(), ex);
2281     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
2282         ew, std::move(req), ctx, eb, "retrieve_binary");
2283     return;
2284   }
2285   auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::string>>>(std::move(req), std::move(ctxStack), return_retrieve_binary<ProtocolIn_,ProtocolOut_>, throw_wrapped_retrieve_binary<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
2286   iface_->async_tm_retrieve_binary(std::move(callback), std::move(uarg_something));
2287 }
2288 
2289 template <class ProtocolIn_, class ProtocolOut_>
return_retrieve_binary(apache::thrift::ContextStack * ctx,::std::string const & _return)2290 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_retrieve_binary(apache::thrift::ContextStack* ctx, ::std::string const& _return) {
2291   ProtocolOut_ prot;
2292   SimpleService_retrieve_binary_presult result;
2293   result.get<0>().value = const_cast<::std::string*>(&_return);
2294   result.setIsSet(0, true);
2295   return serializeResponse(&prot, ctx, result);
2296 }
2297 
2298 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_retrieve_binary(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)2299 void SimpleServiceAsyncProcessor::throw_wrapped_retrieve_binary(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
2300   if (!ew) {
2301     return;
2302   }
2303   {
2304     (void)protoSeqId;
2305     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
2306         ew, std::move(req), reqCtx, ctx, "retrieve_binary");
2307     return;
2308   }
2309 }
2310 
2311 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_contain_binary(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)2312 void SimpleServiceAsyncProcessor::setUpAndProcess_contain_binary(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
2313   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
2314     return;
2315   }
2316   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
2317   ctx->setRequestExecutionScope(std::move(scope));
2318   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_contain_binary<ProtocolIn_, ProtocolOut_>, this);
2319 }
2320 
2321 template <typename ProtocolIn_, typename ProtocolOut_>
process_contain_binary(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)2322 void SimpleServiceAsyncProcessor::process_contain_binary(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
2323   if (!req->getShouldStartProcessing()) {
2324     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
2325     return;
2326   }
2327   // make sure getRequestContext is null
2328   // so async calls don't accidentally use it
2329   iface_->setRequestContext(nullptr);
2330   SimpleService_contain_binary_pargs args;
2331   auto uarg_binaries = std::make_unique<::std::vector<::std::string>>();
2332   args.get<0>().value = uarg_binaries.get();
2333   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.contain_binary", ctx));
2334   try {
2335     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
2336   }
2337   catch (const std::exception& ex) {
2338     folly::exception_wrapper ew(std::current_exception(), ex);
2339     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
2340         ew, std::move(req), ctx, eb, "contain_binary");
2341     return;
2342   }
2343   auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::set<::std::string>>>>(std::move(req), std::move(ctxStack), return_contain_binary<ProtocolIn_,ProtocolOut_>, throw_wrapped_contain_binary<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
2344   iface_->async_tm_contain_binary(std::move(callback), std::move(uarg_binaries));
2345 }
2346 
2347 template <class ProtocolIn_, class ProtocolOut_>
return_contain_binary(apache::thrift::ContextStack * ctx,::std::set<::std::string> const & _return)2348 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_contain_binary(apache::thrift::ContextStack* ctx, ::std::set<::std::string> const& _return) {
2349   ProtocolOut_ prot;
2350   SimpleService_contain_binary_presult result;
2351   result.get<0>().value = const_cast<::std::set<::std::string>*>(&_return);
2352   result.setIsSet(0, true);
2353   return serializeResponse(&prot, ctx, result);
2354 }
2355 
2356 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_contain_binary(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)2357 void SimpleServiceAsyncProcessor::throw_wrapped_contain_binary(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
2358   if (!ew) {
2359     return;
2360   }
2361   {
2362     (void)protoSeqId;
2363     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
2364         ew, std::move(req), reqCtx, ctx, "contain_binary");
2365     return;
2366   }
2367 }
2368 
2369 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_contain_enum(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)2370 void SimpleServiceAsyncProcessor::setUpAndProcess_contain_enum(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
2371   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
2372     return;
2373   }
2374   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
2375   ctx->setRequestExecutionScope(std::move(scope));
2376   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_contain_enum<ProtocolIn_, ProtocolOut_>, this);
2377 }
2378 
2379 template <typename ProtocolIn_, typename ProtocolOut_>
process_contain_enum(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)2380 void SimpleServiceAsyncProcessor::process_contain_enum(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
2381   if (!req->getShouldStartProcessing()) {
2382     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
2383     return;
2384   }
2385   // make sure getRequestContext is null
2386   // so async calls don't accidentally use it
2387   iface_->setRequestContext(nullptr);
2388   SimpleService_contain_enum_pargs args;
2389   auto uarg_the_enum = std::make_unique<::std::vector<::py3::simple::AnEnum>>();
2390   args.get<0>().value = uarg_the_enum.get();
2391   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.contain_enum", ctx));
2392   try {
2393     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
2394   }
2395   catch (const std::exception& ex) {
2396     folly::exception_wrapper ew(std::current_exception(), ex);
2397     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
2398         ew, std::move(req), ctx, eb, "contain_enum");
2399     return;
2400   }
2401   auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::vector<::py3::simple::AnEnum>>>>(std::move(req), std::move(ctxStack), return_contain_enum<ProtocolIn_,ProtocolOut_>, throw_wrapped_contain_enum<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
2402   iface_->async_tm_contain_enum(std::move(callback), std::move(uarg_the_enum));
2403 }
2404 
2405 template <class ProtocolIn_, class ProtocolOut_>
return_contain_enum(apache::thrift::ContextStack * ctx,::std::vector<::py3::simple::AnEnum> const & _return)2406 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_contain_enum(apache::thrift::ContextStack* ctx, ::std::vector<::py3::simple::AnEnum> const& _return) {
2407   ProtocolOut_ prot;
2408   SimpleService_contain_enum_presult result;
2409   result.get<0>().value = const_cast<::std::vector<::py3::simple::AnEnum>*>(&_return);
2410   result.setIsSet(0, true);
2411   return serializeResponse(&prot, ctx, result);
2412 }
2413 
2414 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_contain_enum(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)2415 void SimpleServiceAsyncProcessor::throw_wrapped_contain_enum(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
2416   if (!ew) {
2417     return;
2418   }
2419   {
2420     (void)protoSeqId;
2421     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
2422         ew, std::move(req), reqCtx, ctx, "contain_enum");
2423     return;
2424   }
2425 }
2426 
2427 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_get_binary_union_struct(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)2428 void SimpleServiceAsyncProcessor::setUpAndProcess_get_binary_union_struct(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
2429   if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
2430     return;
2431   }
2432   auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
2433   ctx->setRequestExecutionScope(std::move(scope));
2434   processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &SimpleServiceAsyncProcessor::process_get_binary_union_struct<ProtocolIn_, ProtocolOut_>, this);
2435 }
2436 
2437 template <typename ProtocolIn_, typename ProtocolOut_>
process_get_binary_union_struct(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)2438 void SimpleServiceAsyncProcessor::process_get_binary_union_struct(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
2439   if (!req->getShouldStartProcessing()) {
2440     apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
2441     return;
2442   }
2443   // make sure getRequestContext is null
2444   // so async calls don't accidentally use it
2445   iface_->setRequestContext(nullptr);
2446   SimpleService_get_binary_union_struct_pargs args;
2447   auto uarg_u = std::make_unique<::py3::simple::BinaryUnion>();
2448   args.get<0>().value = uarg_u.get();
2449   std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "SimpleService.get_binary_union_struct", ctx));
2450   try {
2451     deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
2452   }
2453   catch (const std::exception& ex) {
2454     folly::exception_wrapper ew(std::current_exception(), ex);
2455     apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
2456         ew, std::move(req), ctx, eb, "get_binary_union_struct");
2457     return;
2458   }
2459   auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::py3::simple::BinaryUnionStruct>>>(std::move(req), std::move(ctxStack), return_get_binary_union_struct<ProtocolIn_,ProtocolOut_>, throw_wrapped_get_binary_union_struct<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
2460   iface_->async_tm_get_binary_union_struct(std::move(callback), std::move(uarg_u));
2461 }
2462 
2463 template <class ProtocolIn_, class ProtocolOut_>
return_get_binary_union_struct(apache::thrift::ContextStack * ctx,::py3::simple::BinaryUnionStruct const & _return)2464 apache::thrift::SerializedResponse SimpleServiceAsyncProcessor::return_get_binary_union_struct(apache::thrift::ContextStack* ctx, ::py3::simple::BinaryUnionStruct const& _return) {
2465   ProtocolOut_ prot;
2466   SimpleService_get_binary_union_struct_presult result;
2467   result.get<0>().value = const_cast<::py3::simple::BinaryUnionStruct*>(&_return);
2468   result.setIsSet(0, true);
2469   return serializeResponse(&prot, ctx, result);
2470 }
2471 
2472 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_get_binary_union_struct(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)2473 void SimpleServiceAsyncProcessor::throw_wrapped_get_binary_union_struct(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
2474   if (!ew) {
2475     return;
2476   }
2477   {
2478     (void)protoSeqId;
2479     apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
2480         ew, std::move(req), reqCtx, ctx, "get_binary_union_struct");
2481     return;
2482   }
2483 }
2484 
2485 
2486 }} // py3::simple
2487