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/interactions/gen-cpp2/MyService.h"
10
11 #include <thrift/lib/cpp2/gen/service_tcc.h>
12
13 namespace cpp2 {
14 typedef apache::thrift::ThriftPresult<false> MyService_foo_pargs;
15 typedef apache::thrift::ThriftPresult<true> MyService_foo_presult;
16 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_foo(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)17 void MyServiceAsyncProcessor::setUpAndProcess_foo(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
18 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
19 return;
20 }
21 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
22 ctx->setRequestExecutionScope(std::move(scope));
23 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &MyServiceAsyncProcessor::process_foo<ProtocolIn_, ProtocolOut_>, this);
24 }
25
26 template <typename ProtocolIn_, typename ProtocolOut_>
process_foo(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)27 void MyServiceAsyncProcessor::process_foo(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
28 if (!req->getShouldStartProcessing()) {
29 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
30 return;
31 }
32 // make sure getRequestContext is null
33 // so async calls don't accidentally use it
34 iface_->setRequestContext(nullptr);
35 MyService_foo_pargs args;
36 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "MyService.foo", ctx));
37 try {
38 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
39 }
40 catch (const std::exception& ex) {
41 folly::exception_wrapper ew(std::current_exception(), ex);
42 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
43 ew, std::move(req), ctx, eb, "foo");
44 return;
45 }
46 auto callback = std::make_unique<apache::thrift::HandlerCallback<void>>(std::move(req), std::move(ctxStack), return_foo<ProtocolIn_,ProtocolOut_>, throw_wrapped_foo<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
47 iface_->async_tm_foo(std::move(callback));
48 }
49
50 template <class ProtocolIn_, class ProtocolOut_>
return_foo(apache::thrift::ContextStack * ctx)51 apache::thrift::SerializedResponse MyServiceAsyncProcessor::return_foo(apache::thrift::ContextStack* ctx) {
52 ProtocolOut_ prot;
53 MyService_foo_presult result;
54 return serializeResponse(&prot, ctx, result);
55 }
56
57 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_foo(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)58 void MyServiceAsyncProcessor::throw_wrapped_foo(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
59 if (!ew) {
60 return;
61 }
62 {
63 (void)protoSeqId;
64 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
65 ew, std::move(req), reqCtx, ctx, "foo");
66 return;
67 }
68 }
69
70
71 typedef apache::thrift::ThriftPresult<false> MyService_MyInteraction_frobnicate_pargs;
72 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::cpp2::CustomException>> MyService_MyInteraction_frobnicate_presult;
73 typedef apache::thrift::ThriftPresult<false> MyService_MyInteraction_ping_pargs;
74 typedef apache::thrift::ThriftPresult<false> MyService_MyInteraction_truthify_pargs;
75 typedef apache::thrift::ThriftPResultStream<
76 apache::thrift::ThriftPresult<true>,
77 apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, bool*>>
78 > MyService_MyInteraction_truthify_presult;
79 typedef apache::thrift::ThriftPresult<false> MyService_MyInteraction_encode_pargs;
80 typedef apache::thrift::ThriftPResultSink<
81 apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::set<::apache::thrift::type_class::integral>, ::std::set<::std::int32_t>*>>,
82 apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::string, ::std::string*>>,
83 apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::binary, ::std::string*>>
84 > MyService_MyInteraction_encode_presult;
85 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_MyInteraction_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)86 void MyServiceAsyncProcessor::setUpAndProcess_MyInteraction_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
87 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_, "MyInteraction")) {
88 return;
89 }
90 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
91 ctx->setRequestExecutionScope(std::move(scope));
92 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &MyServiceAsyncProcessor::process_MyInteraction_frobnicate<ProtocolIn_, ProtocolOut_>, this);
93 }
94
95 template <typename ProtocolIn_, typename ProtocolOut_>
process_MyInteraction_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)96 void MyServiceAsyncProcessor::process_MyInteraction_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
97 auto tile = ctx->releaseTile();
98 if (!req->getShouldStartProcessing()) {
99 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb, std::move(tile));
100 return;
101 }
102 // make sure getRequestContext is null
103 // so async calls don't accidentally use it
104 iface_->setRequestContext(nullptr);
105 MyService_MyInteraction_frobnicate_pargs args;
106 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "MyService.MyInteraction.frobnicate", ctx));
107 auto& iface = static_cast<MyServiceSvIf::MyInteractionIf&>(*tile);
108 try {
109 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
110 }
111 catch (const std::exception& ex) {
112 folly::exception_wrapper ew(std::current_exception(), ex);
113 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
114 ew, std::move(req), ctx, eb, "MyInteraction.frobnicate");
115 return;
116 }
117 auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int32_t>>(std::move(req), std::move(ctxStack), return_MyInteraction_frobnicate<ProtocolIn_,ProtocolOut_>, throw_wrapped_MyInteraction_frobnicate<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx, nullptr, std::move(tile));
118 iface.async_tm_frobnicate(std::move(callback));
119 }
120
121 template <class ProtocolIn_, class ProtocolOut_>
return_MyInteraction_frobnicate(apache::thrift::ContextStack * ctx,::std::int32_t const & _return)122 apache::thrift::SerializedResponse MyServiceAsyncProcessor::return_MyInteraction_frobnicate(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) {
123 ProtocolOut_ prot;
124 MyService_MyInteraction_frobnicate_presult result;
125 result.get<0>().value = const_cast<::std::int32_t*>(&_return);
126 result.setIsSet(0, true);
127 return serializeResponse(&prot, ctx, result);
128 }
129
130 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_MyInteraction_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)131 void MyServiceAsyncProcessor::throw_wrapped_MyInteraction_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
132 if (!ew) {
133 return;
134 }
135 MyService_MyInteraction_frobnicate_presult result;
136 if (ew.with_exception([&]( ::cpp2::CustomException& e) {
137 if (ctx) {
138 ctx->userExceptionWrapped(true, ew);
139 }
140 ::apache::thrift::util::appendExceptionToHeader(ew, *reqCtx);
141 ::apache::thrift::util::appendErrorClassificationToHeader< ::cpp2::CustomException>(ew, *reqCtx);
142 result.get<1>().ref() = e;
143 result.setIsSet(1, true);
144 }
145 )) {} else
146 {
147 (void)protoSeqId;
148 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
149 ew, std::move(req), reqCtx, ctx, "MyInteraction.frobnicate");
150 return;
151 }
152 ProtocolOut_ prot;
153 auto response = serializeResponse(&prot, ctx, result);
154 auto payload = std::move(response).extractPayload(
155 req->includeEnvelope(), prot.protocolType(), protoSeqId, apache::thrift::MessageType::T_REPLY, "MyInteraction.frobnicate");
156 payload.transform(reqCtx->getHeader()->getWriteTransforms());
157 return req->sendReply(std::move(payload));
158 }
159
160 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_MyInteraction_ping(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)161 void MyServiceAsyncProcessor::setUpAndProcess_MyInteraction_ping(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
162 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_NO_RESPONSE, iface_, "MyInteraction")) {
163 return;
164 }
165 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
166 ctx->setRequestExecutionScope(std::move(scope));
167 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_NO_RESPONSE, &MyServiceAsyncProcessor::process_MyInteraction_ping<ProtocolIn_, ProtocolOut_>, this);
168 }
169
170 template <typename ProtocolIn_, typename ProtocolOut_>
process_MyInteraction_ping(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)171 void MyServiceAsyncProcessor::process_MyInteraction_ping(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
172 auto tile = ctx->releaseTile();
173 // make sure getRequestContext is null
174 // so async calls don't accidentally use it
175 iface_->setRequestContext(nullptr);
176 MyService_MyInteraction_ping_pargs args;
177 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "MyService.MyInteraction.ping", ctx));
178 auto& iface = static_cast<MyServiceSvIf::MyInteractionIf&>(*tile);
179 try {
180 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
181 }
182 catch (const std::exception& ex) {
183 LOG(ERROR) << ex.what() << " in function ping";
184 eb->runInEventBaseThread([req = std::move(req)] {});
185 return;
186 }
187 auto callback = std::make_unique<apache::thrift::HandlerCallbackBase>(std::move(req), std::move(ctxStack), nullptr, eb, tm, ctx, std::move(tile));
188 iface.async_tm_ping(std::move(callback));
189 }
190
191 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_MyInteraction_truthify(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)192 void MyServiceAsyncProcessor::setUpAndProcess_MyInteraction_truthify(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
193 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_STREAMING_RESPONSE, iface_, "MyInteraction")) {
194 return;
195 }
196 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
197 ctx->setRequestExecutionScope(std::move(scope));
198 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_STREAMING_RESPONSE, &MyServiceAsyncProcessor::process_MyInteraction_truthify<ProtocolIn_, ProtocolOut_>, this);
199 }
200
201 template <typename ProtocolIn_, typename ProtocolOut_>
process_MyInteraction_truthify(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)202 void MyServiceAsyncProcessor::process_MyInteraction_truthify(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
203 auto tile = ctx->releaseTile();
204 if (!req->getShouldStartProcessing()) {
205 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb, std::move(tile));
206 return;
207 }
208 // make sure getRequestContext is null
209 // so async calls don't accidentally use it
210 iface_->setRequestContext(nullptr);
211 MyService_MyInteraction_truthify_pargs args;
212 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "MyService.MyInteraction.truthify", ctx));
213 auto& iface = static_cast<MyServiceSvIf::MyInteractionIf&>(*tile);
214 try {
215 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
216 }
217 catch (const std::exception& ex) {
218 folly::exception_wrapper ew(std::current_exception(), ex);
219 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
220 ew, std::move(req), ctx, eb, "MyInteraction.truthify");
221 return;
222 }
223 auto callback = std::make_unique<apache::thrift::HandlerCallback<::apache::thrift::ServerStream<bool>>>(std::move(req), std::move(ctxStack), return_MyInteraction_truthify<ProtocolIn_,ProtocolOut_>, throw_wrapped_MyInteraction_truthify<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx, apache::thrift::ServerInterface::getBlockingThreadManager(tm), std::move(tile));
224 iface.async_tm_truthify(std::move(callback));
225 }
226
227 template <class ProtocolIn_, class ProtocolOut_>
return_MyInteraction_truthify(apache::thrift::ContextStack * ctx,folly::Executor::KeepAlive<> executor,::apache::thrift::ServerStream<bool> && _return)228 apache::thrift::ResponseAndServerStreamFactory MyServiceAsyncProcessor::return_MyInteraction_truthify(apache::thrift::ContextStack* ctx, folly::Executor::KeepAlive<> executor, ::apache::thrift::ServerStream<bool>&& _return) {
229 ProtocolOut_ prot;
230 MyService_MyInteraction_truthify_presult::FieldsType result;
231 using StreamPResultType = MyService_MyInteraction_truthify_presult::StreamPResultType;
232 auto& returnStream = _return;
233
234 using ExMapType = apache::thrift::detail::ap::EmptyExMapType;
235 auto encodedStream = apache::thrift::detail::ap::encode_server_stream<ProtocolOut_, StreamPResultType, ExMapType>(std::move(returnStream), std::move(executor));
236 return {serializeResponse(&prot, ctx, result), std::move(encodedStream)};
237 }
238
239 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_MyInteraction_truthify(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)240 void MyServiceAsyncProcessor::throw_wrapped_MyInteraction_truthify(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
241 if (!ew) {
242 return;
243 }
244 {
245 (void)protoSeqId;
246 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
247 ew, std::move(req), reqCtx, ctx, "MyInteraction.truthify");
248 return;
249 }
250 }
251
252 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_MyInteraction_encode(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)253 void MyServiceAsyncProcessor::setUpAndProcess_MyInteraction_encode(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
254 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINK, iface_, "MyInteraction")) {
255 return;
256 }
257 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
258 ctx->setRequestExecutionScope(std::move(scope));
259 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINK, &MyServiceAsyncProcessor::process_MyInteraction_encode<ProtocolIn_, ProtocolOut_>, this);
260 }
261
262 template <typename ProtocolIn_, typename ProtocolOut_>
process_MyInteraction_encode(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)263 void MyServiceAsyncProcessor::process_MyInteraction_encode(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
264 auto tile = ctx->releaseTile();
265 if (!req->getShouldStartProcessing()) {
266 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb, std::move(tile));
267 return;
268 }
269 // make sure getRequestContext is null
270 // so async calls don't accidentally use it
271 iface_->setRequestContext(nullptr);
272 MyService_MyInteraction_encode_pargs args;
273 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "MyService.MyInteraction.encode", ctx));
274 auto& iface = static_cast<MyServiceSvIf::MyInteractionIf&>(*tile);
275 try {
276 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
277 }
278 catch (const std::exception& ex) {
279 folly::exception_wrapper ew(std::current_exception(), ex);
280 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
281 ew, std::move(req), ctx, eb, "MyInteraction.encode");
282 return;
283 }
284 auto callback = std::make_unique<apache::thrift::HandlerCallback<::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>, ::std::string, ::std::string>>>(std::move(req), std::move(ctxStack), return_MyInteraction_encode<ProtocolIn_,ProtocolOut_>, throw_wrapped_MyInteraction_encode<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx, apache::thrift::ServerInterface::getBlockingThreadManager(tm), std::move(tile));
285 iface.async_tm_encode(std::move(callback));
286 }
287
288 template <class ProtocolIn_, class ProtocolOut_>
return_MyInteraction_encode(apache::thrift::ContextStack * ctx,::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>,::std::string,::std::string> && _return,folly::Executor::KeepAlive<> executor)289 std::pair<apache::thrift::SerializedResponse, apache::thrift::detail::SinkConsumerImpl> MyServiceAsyncProcessor::return_MyInteraction_encode(apache::thrift::ContextStack* ctx, ::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>, ::std::string, ::std::string>&& _return, folly::Executor::KeepAlive<> executor) {
290 ProtocolOut_ prot;
291 MyService_MyInteraction_encode_presult::FieldsType result;
292 using SinkPResultType = MyService_MyInteraction_encode_presult::SinkPResultType;
293 using FinalResponsePResultType = MyService_MyInteraction_encode_presult::FinalResponsePResultType;
294 result.get<0>().value = &_return.response;
295 result.setIsSet(0, true);
296
297 using ExMapType = apache::thrift::detail::ap::EmptyExMapType;
298
299 auto sinkConsumerImpl = apache::thrift::detail::ap::toSinkConsumerImpl<
300 ProtocolIn_,
301 ProtocolOut_,
302 SinkPResultType,
303 FinalResponsePResultType,
304 ExMapType>(
305 std::move(_return.sinkConsumer),
306 std::move(executor));
307
308 return {serializeResponse(&prot, ctx, result), std::move(sinkConsumerImpl)};
309 }
310
311 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_MyInteraction_encode(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)312 void MyServiceAsyncProcessor::throw_wrapped_MyInteraction_encode(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, "MyInteraction.encode");
320 return;
321 }
322 }
323
324 typedef apache::thrift::ThriftPresult<false> MyService_MyInteractionFast_frobnicate_pargs;
325 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> MyService_MyInteractionFast_frobnicate_presult;
326 typedef apache::thrift::ThriftPresult<false> MyService_MyInteractionFast_ping_pargs;
327 typedef apache::thrift::ThriftPresult<false> MyService_MyInteractionFast_truthify_pargs;
328 typedef apache::thrift::ThriftPResultStream<
329 apache::thrift::ThriftPresult<true>,
330 apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, bool*>>
331 > MyService_MyInteractionFast_truthify_presult;
332 typedef apache::thrift::ThriftPresult<false> MyService_MyInteractionFast_encode_pargs;
333 typedef apache::thrift::ThriftPResultSink<
334 apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::set<::apache::thrift::type_class::integral>, ::std::set<::std::int32_t>*>>,
335 apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::string, ::std::string*>>,
336 apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::binary, ::std::string*>>
337 > MyService_MyInteractionFast_encode_presult;
338 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_MyInteractionFast_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)339 void MyServiceAsyncProcessor::setUpAndProcess_MyInteractionFast_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
340 if (!setUpRequestProcessing(req, ctx, eb, nullptr, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_, "MyInteractionFast")) {
341 return;
342 }
343 process_MyInteractionFast_frobnicate<ProtocolIn_, ProtocolOut_>(std::move(req), std::move(serializedRequest), ctx, eb, tm);
344 }
345
346 template <typename ProtocolIn_, typename ProtocolOut_>
process_MyInteractionFast_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)347 void MyServiceAsyncProcessor::process_MyInteractionFast_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
348 auto tile = ctx->releaseTile();
349 if (!req->getShouldStartProcessing()) {
350 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb, std::move(tile));
351 return;
352 }
353 // make sure getRequestContext is null
354 // so async calls don't accidentally use it
355 iface_->setRequestContext(nullptr);
356 MyService_MyInteractionFast_frobnicate_pargs args;
357 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "MyService.MyInteractionFast.frobnicate", ctx));
358 auto& iface = static_cast<MyServiceSvIf::MyInteractionFastIf&>(*tile);
359 try {
360 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
361 }
362 catch (const std::exception& ex) {
363 folly::exception_wrapper ew(std::current_exception(), ex);
364 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
365 ew, std::move(req), ctx, eb, "MyInteractionFast.frobnicate");
366 return;
367 }
368 auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int32_t>>(std::move(req), std::move(ctxStack), return_MyInteractionFast_frobnicate<ProtocolIn_,ProtocolOut_>, throw_wrapped_MyInteractionFast_frobnicate<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx, nullptr, std::move(tile));
369 iface.async_eb_frobnicate(std::move(callback));
370 }
371
372 template <class ProtocolIn_, class ProtocolOut_>
return_MyInteractionFast_frobnicate(apache::thrift::ContextStack * ctx,::std::int32_t const & _return)373 apache::thrift::SerializedResponse MyServiceAsyncProcessor::return_MyInteractionFast_frobnicate(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) {
374 ProtocolOut_ prot;
375 MyService_MyInteractionFast_frobnicate_presult result;
376 result.get<0>().value = const_cast<::std::int32_t*>(&_return);
377 result.setIsSet(0, true);
378 return serializeResponse(&prot, ctx, result);
379 }
380
381 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_MyInteractionFast_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)382 void MyServiceAsyncProcessor::throw_wrapped_MyInteractionFast_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
383 if (!ew) {
384 return;
385 }
386 {
387 (void)protoSeqId;
388 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
389 ew, std::move(req), reqCtx, ctx, "MyInteractionFast.frobnicate");
390 return;
391 }
392 }
393
394 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_MyInteractionFast_ping(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)395 void MyServiceAsyncProcessor::setUpAndProcess_MyInteractionFast_ping(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
396 if (!setUpRequestProcessing(req, ctx, eb, nullptr, apache::thrift::RpcKind::SINGLE_REQUEST_NO_RESPONSE, iface_, "MyInteractionFast")) {
397 return;
398 }
399 process_MyInteractionFast_ping<ProtocolIn_, ProtocolOut_>(std::move(req), std::move(serializedRequest), ctx, eb, tm);
400 }
401
402 template <typename ProtocolIn_, typename ProtocolOut_>
process_MyInteractionFast_ping(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)403 void MyServiceAsyncProcessor::process_MyInteractionFast_ping(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
404 auto tile = ctx->releaseTile();
405 // make sure getRequestContext is null
406 // so async calls don't accidentally use it
407 iface_->setRequestContext(nullptr);
408 MyService_MyInteractionFast_ping_pargs args;
409 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "MyService.MyInteractionFast.ping", ctx));
410 auto& iface = static_cast<MyServiceSvIf::MyInteractionFastIf&>(*tile);
411 try {
412 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
413 }
414 catch (const std::exception& ex) {
415 LOG(ERROR) << ex.what() << " in function ping";
416 eb->runInEventBaseThread([req = std::move(req)] {});
417 return;
418 }
419 auto callback = std::make_unique<apache::thrift::HandlerCallbackBase>(std::move(req), std::move(ctxStack), nullptr, eb, tm, ctx, std::move(tile));
420 iface.async_eb_ping(std::move(callback));
421 }
422
423 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_MyInteractionFast_truthify(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)424 void MyServiceAsyncProcessor::setUpAndProcess_MyInteractionFast_truthify(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
425 if (!setUpRequestProcessing(req, ctx, eb, nullptr, apache::thrift::RpcKind::SINGLE_REQUEST_STREAMING_RESPONSE, iface_, "MyInteractionFast")) {
426 return;
427 }
428 process_MyInteractionFast_truthify<ProtocolIn_, ProtocolOut_>(std::move(req), std::move(serializedRequest), ctx, eb, tm);
429 }
430
431 template <typename ProtocolIn_, typename ProtocolOut_>
process_MyInteractionFast_truthify(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)432 void MyServiceAsyncProcessor::process_MyInteractionFast_truthify(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
433 auto tile = ctx->releaseTile();
434 if (!req->getShouldStartProcessing()) {
435 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb, std::move(tile));
436 return;
437 }
438 // make sure getRequestContext is null
439 // so async calls don't accidentally use it
440 iface_->setRequestContext(nullptr);
441 MyService_MyInteractionFast_truthify_pargs args;
442 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "MyService.MyInteractionFast.truthify", ctx));
443 auto& iface = static_cast<MyServiceSvIf::MyInteractionFastIf&>(*tile);
444 try {
445 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
446 }
447 catch (const std::exception& ex) {
448 folly::exception_wrapper ew(std::current_exception(), ex);
449 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
450 ew, std::move(req), ctx, eb, "MyInteractionFast.truthify");
451 return;
452 }
453 auto callback = std::make_unique<apache::thrift::HandlerCallback<::apache::thrift::ServerStream<bool>>>(std::move(req), std::move(ctxStack), return_MyInteractionFast_truthify<ProtocolIn_,ProtocolOut_>, throw_wrapped_MyInteractionFast_truthify<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx, eb, std::move(tile));
454 iface.async_eb_truthify(std::move(callback));
455 }
456
457 template <class ProtocolIn_, class ProtocolOut_>
return_MyInteractionFast_truthify(apache::thrift::ContextStack * ctx,folly::Executor::KeepAlive<> executor,::apache::thrift::ServerStream<bool> && _return)458 apache::thrift::ResponseAndServerStreamFactory MyServiceAsyncProcessor::return_MyInteractionFast_truthify(apache::thrift::ContextStack* ctx, folly::Executor::KeepAlive<> executor, ::apache::thrift::ServerStream<bool>&& _return) {
459 ProtocolOut_ prot;
460 MyService_MyInteractionFast_truthify_presult::FieldsType result;
461 using StreamPResultType = MyService_MyInteractionFast_truthify_presult::StreamPResultType;
462 auto& returnStream = _return;
463
464 using ExMapType = apache::thrift::detail::ap::EmptyExMapType;
465 auto encodedStream = apache::thrift::detail::ap::encode_server_stream<ProtocolOut_, StreamPResultType, ExMapType>(std::move(returnStream), std::move(executor));
466 return {serializeResponse(&prot, ctx, result), std::move(encodedStream)};
467 }
468
469 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_MyInteractionFast_truthify(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)470 void MyServiceAsyncProcessor::throw_wrapped_MyInteractionFast_truthify(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
471 if (!ew) {
472 return;
473 }
474 {
475 (void)protoSeqId;
476 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
477 ew, std::move(req), reqCtx, ctx, "MyInteractionFast.truthify");
478 return;
479 }
480 }
481
482 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_MyInteractionFast_encode(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)483 void MyServiceAsyncProcessor::setUpAndProcess_MyInteractionFast_encode(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
484 if (!setUpRequestProcessing(req, ctx, eb, nullptr, apache::thrift::RpcKind::SINK, iface_, "MyInteractionFast")) {
485 return;
486 }
487 process_MyInteractionFast_encode<ProtocolIn_, ProtocolOut_>(std::move(req), std::move(serializedRequest), ctx, eb, tm);
488 }
489
490 template <typename ProtocolIn_, typename ProtocolOut_>
process_MyInteractionFast_encode(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)491 void MyServiceAsyncProcessor::process_MyInteractionFast_encode(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
492 auto tile = ctx->releaseTile();
493 if (!req->getShouldStartProcessing()) {
494 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb, std::move(tile));
495 return;
496 }
497 // make sure getRequestContext is null
498 // so async calls don't accidentally use it
499 iface_->setRequestContext(nullptr);
500 MyService_MyInteractionFast_encode_pargs args;
501 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "MyService.MyInteractionFast.encode", ctx));
502 auto& iface = static_cast<MyServiceSvIf::MyInteractionFastIf&>(*tile);
503 try {
504 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
505 }
506 catch (const std::exception& ex) {
507 folly::exception_wrapper ew(std::current_exception(), ex);
508 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
509 ew, std::move(req), ctx, eb, "MyInteractionFast.encode");
510 return;
511 }
512 auto callback = std::make_unique<apache::thrift::HandlerCallback<::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>, ::std::string, ::std::string>>>(std::move(req), std::move(ctxStack), return_MyInteractionFast_encode<ProtocolIn_,ProtocolOut_>, throw_wrapped_MyInteractionFast_encode<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx, eb, std::move(tile));
513 iface.async_eb_encode(std::move(callback));
514 }
515
516 template <class ProtocolIn_, class ProtocolOut_>
return_MyInteractionFast_encode(apache::thrift::ContextStack * ctx,::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>,::std::string,::std::string> && _return,folly::Executor::KeepAlive<> executor)517 std::pair<apache::thrift::SerializedResponse, apache::thrift::detail::SinkConsumerImpl> MyServiceAsyncProcessor::return_MyInteractionFast_encode(apache::thrift::ContextStack* ctx, ::apache::thrift::ResponseAndSinkConsumer<::std::set<::std::int32_t>, ::std::string, ::std::string>&& _return, folly::Executor::KeepAlive<> executor) {
518 ProtocolOut_ prot;
519 MyService_MyInteractionFast_encode_presult::FieldsType result;
520 using SinkPResultType = MyService_MyInteractionFast_encode_presult::SinkPResultType;
521 using FinalResponsePResultType = MyService_MyInteractionFast_encode_presult::FinalResponsePResultType;
522 result.get<0>().value = &_return.response;
523 result.setIsSet(0, true);
524
525 using ExMapType = apache::thrift::detail::ap::EmptyExMapType;
526
527 auto sinkConsumerImpl = apache::thrift::detail::ap::toSinkConsumerImpl<
528 ProtocolIn_,
529 ProtocolOut_,
530 SinkPResultType,
531 FinalResponsePResultType,
532 ExMapType>(
533 std::move(_return.sinkConsumer),
534 std::move(executor));
535
536 return {serializeResponse(&prot, ctx, result), std::move(sinkConsumerImpl)};
537 }
538
539 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_MyInteractionFast_encode(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)540 void MyServiceAsyncProcessor::throw_wrapped_MyInteractionFast_encode(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
541 if (!ew) {
542 return;
543 }
544 {
545 (void)protoSeqId;
546 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
547 ew, std::move(req), reqCtx, ctx, "MyInteractionFast.encode");
548 return;
549 }
550 }
551
552 typedef apache::thrift::ThriftPresult<false> MyService_SerialInteraction_frobnicate_pargs;
553 typedef apache::thrift::ThriftPresult<true> MyService_SerialInteraction_frobnicate_presult;
554 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_SerialInteraction_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)555 void MyServiceAsyncProcessor::setUpAndProcess_SerialInteraction_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
556 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_, "SerialInteraction")) {
557 return;
558 }
559 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
560 ctx->setRequestExecutionScope(std::move(scope));
561 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &MyServiceAsyncProcessor::process_SerialInteraction_frobnicate<ProtocolIn_, ProtocolOut_>, this);
562 }
563
564 template <typename ProtocolIn_, typename ProtocolOut_>
process_SerialInteraction_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)565 void MyServiceAsyncProcessor::process_SerialInteraction_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
566 auto tile = ctx->releaseTile();
567 if (!req->getShouldStartProcessing()) {
568 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb, std::move(tile));
569 return;
570 }
571 // make sure getRequestContext is null
572 // so async calls don't accidentally use it
573 iface_->setRequestContext(nullptr);
574 MyService_SerialInteraction_frobnicate_pargs args;
575 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "MyService.SerialInteraction.frobnicate", ctx));
576 auto& iface = static_cast<MyServiceSvIf::SerialInteractionIf&>(*tile);
577 try {
578 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
579 }
580 catch (const std::exception& ex) {
581 folly::exception_wrapper ew(std::current_exception(), ex);
582 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
583 ew, std::move(req), ctx, eb, "SerialInteraction.frobnicate");
584 return;
585 }
586 auto callback = std::make_unique<apache::thrift::HandlerCallback<void>>(std::move(req), std::move(ctxStack), return_SerialInteraction_frobnicate<ProtocolIn_,ProtocolOut_>, throw_wrapped_SerialInteraction_frobnicate<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx, std::move(tile));
587 iface.async_tm_frobnicate(std::move(callback));
588 }
589
590 template <class ProtocolIn_, class ProtocolOut_>
return_SerialInteraction_frobnicate(apache::thrift::ContextStack * ctx)591 apache::thrift::SerializedResponse MyServiceAsyncProcessor::return_SerialInteraction_frobnicate(apache::thrift::ContextStack* ctx) {
592 ProtocolOut_ prot;
593 MyService_SerialInteraction_frobnicate_presult result;
594 return serializeResponse(&prot, ctx, result);
595 }
596
597 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_SerialInteraction_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)598 void MyServiceAsyncProcessor::throw_wrapped_SerialInteraction_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
599 if (!ew) {
600 return;
601 }
602 {
603 (void)protoSeqId;
604 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
605 ew, std::move(req), reqCtx, ctx, "SerialInteraction.frobnicate");
606 return;
607 }
608 }
609
610 } // cpp2
611