/** * Autogenerated by Thrift for thrift/compiler/test/fixtures/interactions/src/module.thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @nocommit */ #pragma once #include "thrift/compiler/test/fixtures/interactions/gen-cpp2/MyService.h" #include namespace cpp2 { typedef apache::thrift::ThriftPresult MyService_foo_pargs; typedef apache::thrift::ThriftPresult MyService_foo_presult; typedef apache::thrift::ThriftPresult> MyService_interact_pargs; typedef apache::thrift::ThriftPresult MyService_interact_presult; typedef apache::thrift::ThriftPresult MyService_interactFast_pargs; typedef apache::thrift::ThriftPresult> MyService_interactFast_presult; typedef apache::thrift::ThriftPresult MyService_serialize_pargs; typedef apache::thrift::ThriftPResultStream< apache::thrift::ThriftPresult>, apache::thrift::ThriftPresult> > MyService_serialize_presult; template void MyServiceAsyncProcessor::setUpAndProcess_foo(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &MyServiceAsyncProcessor::executeRequest_foo, this); } template void MyServiceAsyncProcessor::executeRequest_foo(apache::thrift::ServerRequest&& serverRequest) { // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); ::cpp2::MyService_foo_pargs args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "MyService.foo", serverRequest.requestContext()); try { deserializeRequest(args, "foo", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "foo"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = std::make_unique>( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , return_foo , throw_wrapped_foo , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) ); iface_->async_tm_foo(std::move(callback)); } template apache::thrift::SerializedResponse MyServiceAsyncProcessor::return_foo(apache::thrift::ContextStack* ctx) { ProtocolOut_ prot; ::cpp2::MyService_foo_presult result; return serializeResponse("foo", &prot, ctx, result); } template void MyServiceAsyncProcessor::throw_wrapped_foo(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "foo"); return; } } template void MyServiceAsyncProcessor::setUpAndProcess_interact(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_, "MyInteraction", true)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &MyServiceAsyncProcessor::executeRequest_interact, this); } template void MyServiceAsyncProcessor::executeRequest_interact(apache::thrift::ServerRequest&& serverRequest) { auto tile = serverRequest.requestContext()->releaseTile(); // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); ::cpp2::MyService_interact_pargs args; ::std::int32_t uarg_arg{0}; args.get<0>().value = &uarg_arg; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "MyService.interact", serverRequest.requestContext()); try { deserializeRequest(args, "interact", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "interact"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = std::make_unique::MyInteractionIf, void>>>( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , return_interact , throw_wrapped_interact , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) , std::move(tile)); iface_->async_tm_interact(std::move(callback), args.get<0>().ref()); } template apache::thrift::SerializedResponse MyServiceAsyncProcessor::return_interact(apache::thrift::ContextStack* ctx) { ProtocolOut_ prot; ::cpp2::MyService_interact_presult result; return serializeResponse("interact", &prot, ctx, result); } template void MyServiceAsyncProcessor::throw_wrapped_interact(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "interact"); return; } } template void MyServiceAsyncProcessor::setUpAndProcess_interactFast(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_, "MyInteractionFast", true)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &MyServiceAsyncProcessor::executeRequest_interactFast, this); } template void MyServiceAsyncProcessor::executeRequest_interactFast(apache::thrift::ServerRequest&& serverRequest) { auto tile = serverRequest.requestContext()->releaseTile(); // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); ::cpp2::MyService_interactFast_pargs args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "MyService.interactFast", serverRequest.requestContext()); try { deserializeRequest(args, "interactFast", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "interactFast"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = std::make_unique::MyInteractionFastIf, ::std::int32_t>>>( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , return_interactFast , throw_wrapped_interactFast , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) , std::move(tile)); iface_->async_tm_interactFast(std::move(callback)); } template apache::thrift::SerializedResponse MyServiceAsyncProcessor::return_interactFast(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) { ProtocolOut_ prot; ::cpp2::MyService_interactFast_presult result; result.get<0>().value = const_cast<::std::int32_t*>(&_return); result.setIsSet(0, true); return serializeResponse("interactFast", &prot, ctx, result); } template void MyServiceAsyncProcessor::throw_wrapped_interactFast(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "interactFast"); return; } } template void MyServiceAsyncProcessor::setUpAndProcess_serialize(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_STREAMING_RESPONSE, iface_, "SerialInteraction", true)) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_STREAMING_RESPONSE, &MyServiceAsyncProcessor::executeRequest_serialize, this); } template void MyServiceAsyncProcessor::executeRequest_serialize(apache::thrift::ServerRequest&& serverRequest) { auto tile = serverRequest.requestContext()->releaseTile(); // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); ::cpp2::MyService_serialize_pargs args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "MyService.serialize", serverRequest.requestContext()); try { deserializeRequest(args, "serialize", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "serialize"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = std::make_unique::SerialInteractionIf, ::apache::thrift::ResponseAndServerStream<::std::int32_t, ::std::int32_t>>>>( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , return_serialize , throw_wrapped_serialize , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) , std::move(tile)); iface_->async_tm_serialize(std::move(callback)); } template apache::thrift::ResponseAndServerStreamFactory MyServiceAsyncProcessor::return_serialize(apache::thrift::ContextStack* ctx, folly::Executor::KeepAlive<> executor, ::apache::thrift::ResponseAndServerStream<::std::int32_t, ::std::int32_t>&& _return) { ProtocolOut_ prot; ::cpp2::MyService_serialize_presult::FieldsType result; using StreamPResultType = ::cpp2::MyService_serialize_presult::StreamPResultType; result.get<0>().value = const_cast<::apache::thrift::ResponseAndServerStream<::std::int32_t, ::std::int32_t>::ResponseType*>(&_return.response); result.setIsSet(0, true); auto& returnStream = _return.stream; using ExMapType = apache::thrift::detail::ap::EmptyExMapType; auto encodedStream = apache::thrift::detail::ap::encode_server_stream(std::move(returnStream), std::move(executor)); return {serializeResponse("serialize", &prot, ctx, result), std::move(encodedStream)}; } template void MyServiceAsyncProcessor::throw_wrapped_serialize(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "serialize"); return; } } typedef apache::thrift::ThriftPresult MyService_MyInteraction_frobnicate_pargs; typedef apache::thrift::ThriftPresult, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::cpp2::CustomException>> MyService_MyInteraction_frobnicate_presult; typedef apache::thrift::ThriftPresult MyService_MyInteraction_ping_pargs; typedef apache::thrift::ThriftPresult MyService_MyInteraction_truthify_pargs; typedef apache::thrift::ThriftPResultStream< apache::thrift::ThriftPresult, apache::thrift::ThriftPresult> > MyService_MyInteraction_truthify_presult; typedef apache::thrift::ThriftPresult MyService_MyInteraction_encode_pargs; typedef apache::thrift::ThriftPResultSink< apache::thrift::ThriftPresult, ::std::set<::std::int32_t>*>>, apache::thrift::ThriftPresult>, apache::thrift::ThriftPresult> > MyService_MyInteraction_encode_presult; template void MyServiceAsyncProcessor::setUpAndProcess_MyInteraction_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_, "MyInteraction")) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &MyServiceAsyncProcessor::executeRequest_MyInteraction_frobnicate, this); } template void MyServiceAsyncProcessor::executeRequest_MyInteraction_frobnicate(apache::thrift::ServerRequest&& serverRequest) { auto tile = serverRequest.requestContext()->releaseTile(); // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); ::cpp2::MyService_MyInteraction_frobnicate_pargs args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "MyService.MyInteraction.frobnicate", serverRequest.requestContext()); auto& iface = static_cast::MyInteractionIf&>(*tile); try { deserializeRequest(args, "MyInteraction.frobnicate", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "MyInteraction.frobnicate"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = std::make_unique>( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , return_MyInteraction_frobnicate , throw_wrapped_MyInteraction_frobnicate , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) , std::move(tile)); iface.async_tm_frobnicate(std::move(callback)); } template apache::thrift::SerializedResponse MyServiceAsyncProcessor::return_MyInteraction_frobnicate(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) { ProtocolOut_ prot; ::cpp2::MyService_MyInteraction_frobnicate_presult result; result.get<0>().value = const_cast<::std::int32_t*>(&_return); result.setIsSet(0, true); return serializeResponse("MyInteraction.frobnicate", &prot, ctx, result); } template void MyServiceAsyncProcessor::throw_wrapped_MyInteraction_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } ::cpp2::MyService_MyInteraction_frobnicate_presult result; if (ew.with_exception([&]( ::cpp2::CustomException& e) { if (ctx) { ctx->userExceptionWrapped(true, ew); } ::apache::thrift::util::appendExceptionToHeader(ew, *reqCtx); ::apache::thrift::util::appendErrorClassificationToHeader< ::cpp2::CustomException>(ew, *reqCtx); result.get<1>().ref() = e; result.setIsSet(1, true); } )) {} else { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "MyInteraction.frobnicate"); return; } ProtocolOut_ prot; auto response = serializeResponse("MyInteraction.frobnicate", &prot, ctx, result); auto payload = std::move(response).extractPayload( req->includeEnvelope(), prot.protocolType(), protoSeqId, apache::thrift::MessageType::T_REPLY, "MyInteraction.frobnicate"); payload.transform(reqCtx->getHeader()->getWriteTransforms()); return req->sendReply(std::move(payload)); } template void MyServiceAsyncProcessor::setUpAndProcess_MyInteraction_ping(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_NO_RESPONSE, iface_, "MyInteraction")) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_NO_RESPONSE, &MyServiceAsyncProcessor::executeRequest_MyInteraction_ping, this); } template void MyServiceAsyncProcessor::executeRequest_MyInteraction_ping(apache::thrift::ServerRequest&& serverRequest) { auto tile = serverRequest.requestContext()->releaseTile(); // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); ::cpp2::MyService_MyInteraction_ping_pargs args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "MyService.MyInteraction.ping", serverRequest.requestContext()); auto& iface = static_cast::MyInteractionIf&>(*tile); try { deserializeRequest(args, "MyInteraction.ping", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { LOG(ERROR) << "exception in function MyInteraction.ping: " << folly::exceptionStr(std::current_exception()); apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest)->runInEventBaseThread([req = apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest))] {}); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = std::make_unique( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , nullptr , nullptr , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) , std::move(tile)); iface.async_tm_ping(std::move(callback)); } template void MyServiceAsyncProcessor::setUpAndProcess_MyInteraction_truthify(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_STREAMING_RESPONSE, iface_, "MyInteraction")) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_STREAMING_RESPONSE, &MyServiceAsyncProcessor::executeRequest_MyInteraction_truthify, this); } template void MyServiceAsyncProcessor::executeRequest_MyInteraction_truthify(apache::thrift::ServerRequest&& serverRequest) { auto tile = serverRequest.requestContext()->releaseTile(); // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); ::cpp2::MyService_MyInteraction_truthify_pargs args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "MyService.MyInteraction.truthify", serverRequest.requestContext()); auto& iface = static_cast::MyInteractionIf&>(*tile); try { deserializeRequest(args, "MyInteraction.truthify", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "MyInteraction.truthify"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = std::make_unique>>( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , return_MyInteraction_truthify , throw_wrapped_MyInteraction_truthify , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) , std::move(tile)); iface.async_tm_truthify(std::move(callback)); } template apache::thrift::ResponseAndServerStreamFactory MyServiceAsyncProcessor::return_MyInteraction_truthify(apache::thrift::ContextStack* ctx, folly::Executor::KeepAlive<> executor, ::apache::thrift::ServerStream&& _return) { ProtocolOut_ prot; ::cpp2::MyService_MyInteraction_truthify_presult::FieldsType result; using StreamPResultType = ::cpp2::MyService_MyInteraction_truthify_presult::StreamPResultType; auto& returnStream = _return; using ExMapType = apache::thrift::detail::ap::EmptyExMapType; auto encodedStream = apache::thrift::detail::ap::encode_server_stream(std::move(returnStream), std::move(executor)); return {serializeResponse("MyInteraction.truthify", &prot, ctx, result), std::move(encodedStream)}; } template void MyServiceAsyncProcessor::throw_wrapped_MyInteraction_truthify(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "MyInteraction.truthify"); return; } } template void MyServiceAsyncProcessor::setUpAndProcess_MyInteraction_encode(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINK, iface_, "MyInteraction")) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINK, &MyServiceAsyncProcessor::executeRequest_MyInteraction_encode, this); } template void MyServiceAsyncProcessor::executeRequest_MyInteraction_encode(apache::thrift::ServerRequest&& serverRequest) { auto tile = serverRequest.requestContext()->releaseTile(); // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); ::cpp2::MyService_MyInteraction_encode_pargs args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "MyService.MyInteraction.encode", serverRequest.requestContext()); auto& iface = static_cast::MyInteractionIf&>(*tile); try { deserializeRequest(args, "MyInteraction.encode", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "MyInteraction.encode"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = std::make_unique, ::std::string, ::std::string>>>( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , return_MyInteraction_encode , throw_wrapped_MyInteraction_encode , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) , std::move(tile)); iface.async_tm_encode(std::move(callback)); } template std::pair 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) { ProtocolOut_ prot; ::cpp2::MyService_MyInteraction_encode_presult::FieldsType result; using SinkPResultType = ::cpp2::MyService_MyInteraction_encode_presult::SinkPResultType; using FinalResponsePResultType = ::cpp2::MyService_MyInteraction_encode_presult::FinalResponsePResultType; result.get<0>().value = &_return.response; result.setIsSet(0, true); using ExMapType = apache::thrift::detail::ap::EmptyExMapType; auto sinkConsumerImpl = apache::thrift::detail::ap::toSinkConsumerImpl< ProtocolIn_, ProtocolOut_, SinkPResultType, FinalResponsePResultType, ExMapType>( std::move(_return.sinkConsumer), std::move(executor)); return {serializeResponse("MyInteraction.encode", &prot, ctx, result), std::move(sinkConsumerImpl)}; } template void MyServiceAsyncProcessor::throw_wrapped_MyInteraction_encode(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "MyInteraction.encode"); return; } } typedef apache::thrift::ThriftPresult MyService_MyInteractionFast_frobnicate_pargs; typedef apache::thrift::ThriftPresult> MyService_MyInteractionFast_frobnicate_presult; typedef apache::thrift::ThriftPresult MyService_MyInteractionFast_ping_pargs; typedef apache::thrift::ThriftPresult MyService_MyInteractionFast_truthify_pargs; typedef apache::thrift::ThriftPResultStream< apache::thrift::ThriftPresult, apache::thrift::ThriftPresult> > MyService_MyInteractionFast_truthify_presult; typedef apache::thrift::ThriftPresult MyService_MyInteractionFast_encode_pargs; typedef apache::thrift::ThriftPResultSink< apache::thrift::ThriftPresult, ::std::set<::std::int32_t>*>>, apache::thrift::ThriftPresult>, apache::thrift::ThriftPresult> > MyService_MyInteractionFast_encode_presult; template void MyServiceAsyncProcessor::setUpAndProcess_MyInteractionFast_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, nullptr, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_, "MyInteractionFast")) { return; } processInThread(std::move(req), std::move(serializedRequest), ctx, eb, nullptr, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &MyServiceAsyncProcessor::executeRequest_MyInteractionFast_frobnicate, this); } template void MyServiceAsyncProcessor::executeRequest_MyInteractionFast_frobnicate(apache::thrift::ServerRequest&& serverRequest) { auto tile = serverRequest.requestContext()->releaseTile(); // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); ::cpp2::MyService_MyInteractionFast_frobnicate_pargs args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "MyService.MyInteractionFast.frobnicate", serverRequest.requestContext()); auto& iface = static_cast::MyInteractionFastIf&>(*tile); try { deserializeRequest(args, "MyInteractionFast.frobnicate", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "MyInteractionFast.frobnicate"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = std::make_unique>( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , return_MyInteractionFast_frobnicate , throw_wrapped_MyInteractionFast_frobnicate , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , nullptr , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) , std::move(tile)); iface.async_eb_frobnicate(std::move(callback)); } template apache::thrift::SerializedResponse MyServiceAsyncProcessor::return_MyInteractionFast_frobnicate(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) { ProtocolOut_ prot; ::cpp2::MyService_MyInteractionFast_frobnicate_presult result; result.get<0>().value = const_cast<::std::int32_t*>(&_return); result.setIsSet(0, true); return serializeResponse("MyInteractionFast.frobnicate", &prot, ctx, result); } template void MyServiceAsyncProcessor::throw_wrapped_MyInteractionFast_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "MyInteractionFast.frobnicate"); return; } } template void MyServiceAsyncProcessor::setUpAndProcess_MyInteractionFast_ping(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, nullptr, apache::thrift::RpcKind::SINGLE_REQUEST_NO_RESPONSE, iface_, "MyInteractionFast")) { return; } processInThread(std::move(req), std::move(serializedRequest), ctx, eb, nullptr, apache::thrift::RpcKind::SINGLE_REQUEST_NO_RESPONSE, &MyServiceAsyncProcessor::executeRequest_MyInteractionFast_ping, this); } template void MyServiceAsyncProcessor::executeRequest_MyInteractionFast_ping(apache::thrift::ServerRequest&& serverRequest) { auto tile = serverRequest.requestContext()->releaseTile(); // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); ::cpp2::MyService_MyInteractionFast_ping_pargs args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "MyService.MyInteractionFast.ping", serverRequest.requestContext()); auto& iface = static_cast::MyInteractionFastIf&>(*tile); try { deserializeRequest(args, "MyInteractionFast.ping", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { LOG(ERROR) << "exception in function MyInteractionFast.ping: " << folly::exceptionStr(std::current_exception()); apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest)->runInEventBaseThread([req = apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest))] {}); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = std::make_unique( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , nullptr , nullptr , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) , std::move(tile)); iface.async_eb_ping(std::move(callback)); } template void MyServiceAsyncProcessor::setUpAndProcess_MyInteractionFast_truthify(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, nullptr, apache::thrift::RpcKind::SINGLE_REQUEST_STREAMING_RESPONSE, iface_, "MyInteractionFast")) { return; } processInThread(std::move(req), std::move(serializedRequest), ctx, eb, nullptr, apache::thrift::RpcKind::SINGLE_REQUEST_STREAMING_RESPONSE, &MyServiceAsyncProcessor::executeRequest_MyInteractionFast_truthify, this); } template void MyServiceAsyncProcessor::executeRequest_MyInteractionFast_truthify(apache::thrift::ServerRequest&& serverRequest) { auto tile = serverRequest.requestContext()->releaseTile(); // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); ::cpp2::MyService_MyInteractionFast_truthify_pargs args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "MyService.MyInteractionFast.truthify", serverRequest.requestContext()); auto& iface = static_cast::MyInteractionFastIf&>(*tile); try { deserializeRequest(args, "MyInteractionFast.truthify", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "MyInteractionFast.truthify"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = std::make_unique>>( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , return_MyInteractionFast_truthify , throw_wrapped_MyInteractionFast_truthify , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , nullptr , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) , std::move(tile)); iface.async_eb_truthify(std::move(callback)); } template apache::thrift::ResponseAndServerStreamFactory MyServiceAsyncProcessor::return_MyInteractionFast_truthify(apache::thrift::ContextStack* ctx, folly::Executor::KeepAlive<> executor, ::apache::thrift::ServerStream&& _return) { ProtocolOut_ prot; ::cpp2::MyService_MyInteractionFast_truthify_presult::FieldsType result; using StreamPResultType = ::cpp2::MyService_MyInteractionFast_truthify_presult::StreamPResultType; auto& returnStream = _return; using ExMapType = apache::thrift::detail::ap::EmptyExMapType; auto encodedStream = apache::thrift::detail::ap::encode_server_stream(std::move(returnStream), std::move(executor)); return {serializeResponse("MyInteractionFast.truthify", &prot, ctx, result), std::move(encodedStream)}; } template void MyServiceAsyncProcessor::throw_wrapped_MyInteractionFast_truthify(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "MyInteractionFast.truthify"); return; } } template void MyServiceAsyncProcessor::setUpAndProcess_MyInteractionFast_encode(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, nullptr, apache::thrift::RpcKind::SINK, iface_, "MyInteractionFast")) { return; } processInThread(std::move(req), std::move(serializedRequest), ctx, eb, nullptr, apache::thrift::RpcKind::SINK, &MyServiceAsyncProcessor::executeRequest_MyInteractionFast_encode, this); } template void MyServiceAsyncProcessor::executeRequest_MyInteractionFast_encode(apache::thrift::ServerRequest&& serverRequest) { auto tile = serverRequest.requestContext()->releaseTile(); // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); ::cpp2::MyService_MyInteractionFast_encode_pargs args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "MyService.MyInteractionFast.encode", serverRequest.requestContext()); auto& iface = static_cast::MyInteractionFastIf&>(*tile); try { deserializeRequest(args, "MyInteractionFast.encode", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "MyInteractionFast.encode"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = std::make_unique, ::std::string, ::std::string>>>( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , return_MyInteractionFast_encode , throw_wrapped_MyInteractionFast_encode , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , nullptr , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) , std::move(tile)); iface.async_eb_encode(std::move(callback)); } template std::pair 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) { ProtocolOut_ prot; ::cpp2::MyService_MyInteractionFast_encode_presult::FieldsType result; using SinkPResultType = ::cpp2::MyService_MyInteractionFast_encode_presult::SinkPResultType; using FinalResponsePResultType = ::cpp2::MyService_MyInteractionFast_encode_presult::FinalResponsePResultType; result.get<0>().value = &_return.response; result.setIsSet(0, true); using ExMapType = apache::thrift::detail::ap::EmptyExMapType; auto sinkConsumerImpl = apache::thrift::detail::ap::toSinkConsumerImpl< ProtocolIn_, ProtocolOut_, SinkPResultType, FinalResponsePResultType, ExMapType>( std::move(_return.sinkConsumer), std::move(executor)); return {serializeResponse("MyInteractionFast.encode", &prot, ctx, result), std::move(sinkConsumerImpl)}; } template void MyServiceAsyncProcessor::throw_wrapped_MyInteractionFast_encode(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "MyInteractionFast.encode"); return; } } typedef apache::thrift::ThriftPresult MyService_SerialInteraction_frobnicate_pargs; typedef apache::thrift::ThriftPresult MyService_SerialInteraction_frobnicate_presult; template void MyServiceAsyncProcessor::setUpAndProcess_SerialInteraction_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, [[maybe_unused]] apache::thrift::concurrency::ThreadManager* tm) { if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_, "SerialInteraction")) { return; } auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL); ctx->setRequestExecutionScope(std::move(scope)); processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &MyServiceAsyncProcessor::executeRequest_SerialInteraction_frobnicate, this); } template void MyServiceAsyncProcessor::executeRequest_SerialInteraction_frobnicate(apache::thrift::ServerRequest&& serverRequest) { auto tile = serverRequest.requestContext()->releaseTile(); // make sure getRequestContext is null // so async calls don't accidentally use it iface_->setRequestContext(nullptr); ::cpp2::MyService_SerialInteraction_frobnicate_pargs args; auto ctxStack = apache::thrift::ContextStack::create( this->getEventHandlersSharedPtr(), this->getServiceName(), "MyService.SerialInteraction.frobnicate", serverRequest.requestContext()); auto& iface = static_cast::SerialInteractionIf&>(*tile); try { deserializeRequest(args, "SerialInteraction.frobnicate", apache::thrift::detail::ServerRequestHelper::compressedRequest(std::move(serverRequest)).uncompress(), ctxStack.get()); } catch (...) { folly::exception_wrapper ew(std::current_exception()); apache::thrift::detail::ap::process_handle_exn_deserialization( ew , apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , serverRequest.requestContext() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , "SerialInteraction.frobnicate"); return; } auto requestPileNotification = apache::thrift::detail::ServerRequestHelper::moveRequestPileNotification(serverRequest); auto concurrencyControllerNotification = apache::thrift::detail::ServerRequestHelper::moveConcurrencyControllerNotification(serverRequest); auto callback = std::make_unique>( apache::thrift::detail::ServerRequestHelper::request(std::move(serverRequest)) , std::move(ctxStack) , return_SerialInteraction_frobnicate , throw_wrapped_SerialInteraction_frobnicate , serverRequest.requestContext()->getProtoSeqId() , apache::thrift::detail::ServerRequestHelper::eventBase(serverRequest) , apache::thrift::detail::ServerRequestHelper::executor(serverRequest) , serverRequest.requestContext() , requestPileNotification , concurrencyControllerNotification, std::move(serverRequest.requestData()) , std::move(tile)); iface.async_tm_frobnicate(std::move(callback)); } template apache::thrift::SerializedResponse MyServiceAsyncProcessor::return_SerialInteraction_frobnicate(apache::thrift::ContextStack* ctx) { ProtocolOut_ prot; ::cpp2::MyService_SerialInteraction_frobnicate_presult result; return serializeResponse("SerialInteraction.frobnicate", &prot, ctx, result); } template void MyServiceAsyncProcessor::throw_wrapped_SerialInteraction_frobnicate(apache::thrift::ResponseChannelRequest::UniquePtr req,[[maybe_unused]] int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) { if (!ew) { return; } { apache::thrift::detail::ap::process_throw_wrapped_handler_error( ew, std::move(req), reqCtx, ctx, "SerialInteraction.frobnicate"); return; } } } // namespace cpp2