/** * Autogenerated by Thrift for thrift/compiler/test/fixtures/sink/src/module.thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @nocommit */ #include "thrift/compiler/test/fixtures/sink/gen-cpp2/SinkServiceAsyncClient.h" #include namespace cpp2 { typedef apache::thrift::ThriftPresult SinkService_method_pargs; typedef apache::thrift::ThriftPResultSink< apache::thrift::ThriftPresult, apache::thrift::ThriftPresult>, apache::thrift::ThriftPresult> > SinkService_method_presult; typedef apache::thrift::ThriftPresult SinkService_methodAndReponse_pargs; typedef apache::thrift::ThriftPResultSink< apache::thrift::ThriftPresult>, apache::thrift::ThriftPresult>, apache::thrift::ThriftPresult> > SinkService_methodAndReponse_presult; typedef apache::thrift::ThriftPresult SinkService_methodThrow_pargs; typedef apache::thrift::ThriftPResultSink< apache::thrift::ThriftPresult>, apache::thrift::ThriftPresult>, apache::thrift::ThriftPresult> > SinkService_methodThrow_presult; typedef apache::thrift::ThriftPresult SinkService_methodSinkThrow_pargs; typedef apache::thrift::ThriftPResultSink< apache::thrift::ThriftPresult, apache::thrift::ThriftPresult, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::cpp2::SinkException1>>, apache::thrift::ThriftPresult> > SinkService_methodSinkThrow_presult; typedef apache::thrift::ThriftPresult SinkService_methodFinalThrow_pargs; typedef apache::thrift::ThriftPResultSink< apache::thrift::ThriftPresult, apache::thrift::ThriftPresult>, apache::thrift::ThriftPresult, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::cpp2::SinkException2>> > SinkService_methodFinalThrow_presult; typedef apache::thrift::ThriftPresult SinkService_methodBothThrow_pargs; typedef apache::thrift::ThriftPResultSink< apache::thrift::ThriftPresult, apache::thrift::ThriftPresult, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::cpp2::SinkException1>>, apache::thrift::ThriftPresult, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::cpp2::SinkException2>> > SinkService_methodBothThrow_presult; typedef apache::thrift::ThriftPresult SinkService_methodFast_pargs; typedef apache::thrift::ThriftPResultSink< apache::thrift::ThriftPresult, apache::thrift::ThriftPresult>, apache::thrift::ThriftPresult> > SinkService_methodFast_presult; } // namespace cpp2 template apache::thrift::SerializedRequest apache::thrift::Client<::cpp2::SinkService>::fbthrift_serialize_method(Protocol_* prot, const RpcOptions& rpcOptions, apache::thrift::transport::THeader& header, apache::thrift::ContextStack* contextStack) { ::cpp2::SinkService_method_pargs args; const auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; const auto writer = [&](Protocol_* p) { args.write(p); }; return apache::thrift::preprocessSendT( prot, rpcOptions, contextStack, header, "method", writer, sizer, channel_->getChecksumSamplingRate()); } template void apache::thrift::Client<::cpp2::SinkService>::fbthrift_send_method(apache::thrift::SerializedRequest&& request, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::SinkClientCallback* callback) { static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "method", ::apache::thrift::FunctionQualifier::Unspecified, "SinkService"); apache::thrift::clientSendT(std::move(request), std::forward(rpcOptions), std::move(callback), std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata)); } template apache::thrift::SerializedRequest apache::thrift::Client<::cpp2::SinkService>::fbthrift_serialize_methodAndReponse(Protocol_* prot, const RpcOptions& rpcOptions, apache::thrift::transport::THeader& header, apache::thrift::ContextStack* contextStack) { ::cpp2::SinkService_methodAndReponse_pargs args; const auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; const auto writer = [&](Protocol_* p) { args.write(p); }; return apache::thrift::preprocessSendT( prot, rpcOptions, contextStack, header, "methodAndReponse", writer, sizer, channel_->getChecksumSamplingRate()); } template void apache::thrift::Client<::cpp2::SinkService>::fbthrift_send_methodAndReponse(apache::thrift::SerializedRequest&& request, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::SinkClientCallback* callback) { static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "methodAndReponse", ::apache::thrift::FunctionQualifier::Unspecified, "SinkService"); apache::thrift::clientSendT(std::move(request), std::forward(rpcOptions), std::move(callback), std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata)); } template apache::thrift::SerializedRequest apache::thrift::Client<::cpp2::SinkService>::fbthrift_serialize_methodThrow(Protocol_* prot, const RpcOptions& rpcOptions, apache::thrift::transport::THeader& header, apache::thrift::ContextStack* contextStack) { ::cpp2::SinkService_methodThrow_pargs args; const auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; const auto writer = [&](Protocol_* p) { args.write(p); }; return apache::thrift::preprocessSendT( prot, rpcOptions, contextStack, header, "methodThrow", writer, sizer, channel_->getChecksumSamplingRate()); } template void apache::thrift::Client<::cpp2::SinkService>::fbthrift_send_methodThrow(apache::thrift::SerializedRequest&& request, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::SinkClientCallback* callback) { static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "methodThrow", ::apache::thrift::FunctionQualifier::Unspecified, "SinkService"); apache::thrift::clientSendT(std::move(request), std::forward(rpcOptions), std::move(callback), std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata)); } template apache::thrift::SerializedRequest apache::thrift::Client<::cpp2::SinkService>::fbthrift_serialize_methodSinkThrow(Protocol_* prot, const RpcOptions& rpcOptions, apache::thrift::transport::THeader& header, apache::thrift::ContextStack* contextStack) { ::cpp2::SinkService_methodSinkThrow_pargs args; const auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; const auto writer = [&](Protocol_* p) { args.write(p); }; return apache::thrift::preprocessSendT( prot, rpcOptions, contextStack, header, "methodSinkThrow", writer, sizer, channel_->getChecksumSamplingRate()); } template void apache::thrift::Client<::cpp2::SinkService>::fbthrift_send_methodSinkThrow(apache::thrift::SerializedRequest&& request, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::SinkClientCallback* callback) { static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "methodSinkThrow", ::apache::thrift::FunctionQualifier::Unspecified, "SinkService"); apache::thrift::clientSendT(std::move(request), std::forward(rpcOptions), std::move(callback), std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata)); } template apache::thrift::SerializedRequest apache::thrift::Client<::cpp2::SinkService>::fbthrift_serialize_methodFinalThrow(Protocol_* prot, const RpcOptions& rpcOptions, apache::thrift::transport::THeader& header, apache::thrift::ContextStack* contextStack) { ::cpp2::SinkService_methodFinalThrow_pargs args; const auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; const auto writer = [&](Protocol_* p) { args.write(p); }; return apache::thrift::preprocessSendT( prot, rpcOptions, contextStack, header, "methodFinalThrow", writer, sizer, channel_->getChecksumSamplingRate()); } template void apache::thrift::Client<::cpp2::SinkService>::fbthrift_send_methodFinalThrow(apache::thrift::SerializedRequest&& request, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::SinkClientCallback* callback) { static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "methodFinalThrow", ::apache::thrift::FunctionQualifier::Unspecified, "SinkService"); apache::thrift::clientSendT(std::move(request), std::forward(rpcOptions), std::move(callback), std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata)); } template apache::thrift::SerializedRequest apache::thrift::Client<::cpp2::SinkService>::fbthrift_serialize_methodBothThrow(Protocol_* prot, const RpcOptions& rpcOptions, apache::thrift::transport::THeader& header, apache::thrift::ContextStack* contextStack) { ::cpp2::SinkService_methodBothThrow_pargs args; const auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; const auto writer = [&](Protocol_* p) { args.write(p); }; return apache::thrift::preprocessSendT( prot, rpcOptions, contextStack, header, "methodBothThrow", writer, sizer, channel_->getChecksumSamplingRate()); } template void apache::thrift::Client<::cpp2::SinkService>::fbthrift_send_methodBothThrow(apache::thrift::SerializedRequest&& request, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::SinkClientCallback* callback) { static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "methodBothThrow", ::apache::thrift::FunctionQualifier::Unspecified, "SinkService"); apache::thrift::clientSendT(std::move(request), std::forward(rpcOptions), std::move(callback), std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata)); } template apache::thrift::SerializedRequest apache::thrift::Client<::cpp2::SinkService>::fbthrift_serialize_methodFast(Protocol_* prot, const RpcOptions& rpcOptions, apache::thrift::transport::THeader& header, apache::thrift::ContextStack* contextStack) { ::cpp2::SinkService_methodFast_pargs args; const auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; const auto writer = [&](Protocol_* p) { args.write(p); }; return apache::thrift::preprocessSendT( prot, rpcOptions, contextStack, header, "methodFast", writer, sizer, channel_->getChecksumSamplingRate()); } template void apache::thrift::Client<::cpp2::SinkService>::fbthrift_send_methodFast(apache::thrift::SerializedRequest&& request, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::SinkClientCallback* callback) { static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "methodFast", ::apache::thrift::FunctionQualifier::Unspecified, "SinkService"); apache::thrift::clientSendT(std::move(request), std::forward(rpcOptions), std::move(callback), std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata)); } void apache::thrift::Client<::cpp2::SinkService>::fbthrift_serialize_and_send_method(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::SinkClientCallback* callback, bool stealRpcOptions) { apache::thrift::detail::ac::withProtocolWriter(apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(), [&](auto&& writer) { apache::thrift::SerializedRequest request = fbthrift_serialize_method(&writer, rpcOptions, *header, contextStack); if (stealRpcOptions) { fbthrift_send_method(std::move(request), std::move(rpcOptions), std::move(header), std::move(callback)); } else { fbthrift_send_method(std::move(request), rpcOptions, std::move(header), std::move(callback)); } }); } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::cpp2::SinkService>::methodCtx(apache::thrift::RpcOptions* rpcOptions) { auto header = std::make_shared( apache::thrift::transport::THeader::ALLOW_BIG_FRAMES); header->setProtocolId(channel_->getProtocolId()); if (rpcOptions) { header->setHeaders(rpcOptions->releaseWriteHeaders()); } auto ctx = apache::thrift::ContextStack::createWithClientContext( handlers_, interceptors_, getServiceName(), "SinkService.method", *header); return {std::move(ctx), std::move(header)}; } #if FOLLY_HAS_COROUTINES folly::coro::Task> apache::thrift::Client<::cpp2::SinkService>::co_method() { ::apache::thrift::RpcOptions rpcOptions; co_return co_await co_method(rpcOptions); } folly::coro::Task> apache::thrift::Client<::cpp2::SinkService>::co_method(apache::thrift::RpcOptions& rpcOptions) { const folly::CancellationToken& cancelToken = co_await folly::coro::co_current_cancellation_token; const bool cancellable = cancelToken.canBeCancelled(); apache::thrift::ClientReceiveState returnState; apache::thrift::ClientCoroCallback callback(&returnState, co_await folly::coro::co_current_executor); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto [ctx, header] = methodCtx(&rpcOptions); using CancellableCallback = apache::thrift::CancellableRequestClientCallback; auto cancellableCallback = cancellable ? CancellableCallback::create(&callback, channel_) : nullptr; auto wrappedCallback = apache::thrift::createSinkClientCallback( apache::thrift::RequestClientCallback::Ptr(apache::thrift::RequestClientCallback::Ptr(cancellableCallback ? (apache::thrift::RequestClientCallback*)cancellableCallback.get() : &callback))); fbthrift_serialize_and_send_method(rpcOptions, std::move(header), ctx.get(), wrappedCallback); if (cancellable) { folly::CancellationCallback cb(cancelToken, [&] { CancellableCallback::cancel(std::move(cancellableCallback)); }); co_await callback.co_waitUntilDone(); } else { co_await callback.co_waitUntilDone(); } if (returnState.isException()) { co_yield folly::coro::co_error(std::move(returnState.exception())); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctx)); co_return recv_method(returnState); } #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::SinkService>::recv_wrapped_method(apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse>& _return, ::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } if (!state.hasResponseBuffer()) { return folly::make_exception_wrapper("recv_ called without result"); } using result = ::cpp2::SinkService_method_presult; using ExMapType = apache::thrift::detail::ap::EmptyExMapType; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, state.extractSink(), _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, state.extractSink(), _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse> apache::thrift::Client<::cpp2::SinkService>::recv_method(::apache::thrift::ClientReceiveState& state) { apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse> _return; auto ew = recv_wrapped_method(_return, state); if (ew) { ew.throw_exception(); } return _return; } apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse> apache::thrift::Client<::cpp2::SinkService>::recv_instance_method(::apache::thrift::ClientReceiveState& state) { return recv_method(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::SinkService>::recv_instance_wrapped_method(apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse>& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_method(_return, state); } void apache::thrift::Client<::cpp2::SinkService>::fbthrift_serialize_and_send_methodAndReponse(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::SinkClientCallback* callback, bool stealRpcOptions) { apache::thrift::detail::ac::withProtocolWriter(apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(), [&](auto&& writer) { apache::thrift::SerializedRequest request = fbthrift_serialize_methodAndReponse(&writer, rpcOptions, *header, contextStack); if (stealRpcOptions) { fbthrift_send_methodAndReponse(std::move(request), std::move(rpcOptions), std::move(header), std::move(callback)); } else { fbthrift_send_methodAndReponse(std::move(request), rpcOptions, std::move(header), std::move(callback)); } }); } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::cpp2::SinkService>::methodAndReponseCtx(apache::thrift::RpcOptions* rpcOptions) { auto header = std::make_shared( apache::thrift::transport::THeader::ALLOW_BIG_FRAMES); header->setProtocolId(channel_->getProtocolId()); if (rpcOptions) { header->setHeaders(rpcOptions->releaseWriteHeaders()); } auto ctx = apache::thrift::ContextStack::createWithClientContext( handlers_, interceptors_, getServiceName(), "SinkService.methodAndReponse", *header); return {std::move(ctx), std::move(header)}; } #if FOLLY_HAS_COROUTINES folly::coro::Task> apache::thrift::Client<::cpp2::SinkService>::co_methodAndReponse() { ::apache::thrift::RpcOptions rpcOptions; co_return co_await co_methodAndReponse(rpcOptions); } folly::coro::Task> apache::thrift::Client<::cpp2::SinkService>::co_methodAndReponse(apache::thrift::RpcOptions& rpcOptions) { const folly::CancellationToken& cancelToken = co_await folly::coro::co_current_cancellation_token; const bool cancellable = cancelToken.canBeCancelled(); apache::thrift::ClientReceiveState returnState; apache::thrift::ClientCoroCallback callback(&returnState, co_await folly::coro::co_current_executor); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto [ctx, header] = methodAndReponseCtx(&rpcOptions); using CancellableCallback = apache::thrift::CancellableRequestClientCallback; auto cancellableCallback = cancellable ? CancellableCallback::create(&callback, channel_) : nullptr; auto wrappedCallback = apache::thrift::createSinkClientCallback( apache::thrift::RequestClientCallback::Ptr(apache::thrift::RequestClientCallback::Ptr(cancellableCallback ? (apache::thrift::RequestClientCallback*)cancellableCallback.get() : &callback))); fbthrift_serialize_and_send_methodAndReponse(rpcOptions, std::move(header), ctx.get(), wrappedCallback); if (cancellable) { folly::CancellationCallback cb(cancelToken, [&] { CancellableCallback::cancel(std::move(cancellableCallback)); }); co_await callback.co_waitUntilDone(); } else { co_await callback.co_waitUntilDone(); } if (returnState.isException()) { co_yield folly::coro::co_error(std::move(returnState.exception())); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctx)); co_return recv_methodAndReponse(returnState); } #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::SinkService>::recv_wrapped_methodAndReponse(apache::thrift::ResponseAndClientSink<::cpp2::InitialResponse, ::cpp2::SinkPayload, ::cpp2::FinalResponse>& _return, ::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } if (!state.hasResponseBuffer()) { return folly::make_exception_wrapper("recv_ called without result"); } using result = ::cpp2::SinkService_methodAndReponse_presult; using ExMapType = apache::thrift::detail::ap::EmptyExMapType; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, state.extractSink(), _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, state.extractSink(), _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } apache::thrift::ResponseAndClientSink<::cpp2::InitialResponse, ::cpp2::SinkPayload, ::cpp2::FinalResponse> apache::thrift::Client<::cpp2::SinkService>::recv_methodAndReponse(::apache::thrift::ClientReceiveState& state) { apache::thrift::ResponseAndClientSink<::cpp2::InitialResponse, ::cpp2::SinkPayload, ::cpp2::FinalResponse> _return; auto ew = recv_wrapped_methodAndReponse(_return, state); if (ew) { ew.throw_exception(); } return _return; } apache::thrift::ResponseAndClientSink<::cpp2::InitialResponse, ::cpp2::SinkPayload, ::cpp2::FinalResponse> apache::thrift::Client<::cpp2::SinkService>::recv_instance_methodAndReponse(::apache::thrift::ClientReceiveState& state) { return recv_methodAndReponse(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::SinkService>::recv_instance_wrapped_methodAndReponse(apache::thrift::ResponseAndClientSink<::cpp2::InitialResponse, ::cpp2::SinkPayload, ::cpp2::FinalResponse>& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_methodAndReponse(_return, state); } void apache::thrift::Client<::cpp2::SinkService>::fbthrift_serialize_and_send_methodThrow(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::SinkClientCallback* callback, bool stealRpcOptions) { apache::thrift::detail::ac::withProtocolWriter(apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(), [&](auto&& writer) { apache::thrift::SerializedRequest request = fbthrift_serialize_methodThrow(&writer, rpcOptions, *header, contextStack); if (stealRpcOptions) { fbthrift_send_methodThrow(std::move(request), std::move(rpcOptions), std::move(header), std::move(callback)); } else { fbthrift_send_methodThrow(std::move(request), rpcOptions, std::move(header), std::move(callback)); } }); } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::cpp2::SinkService>::methodThrowCtx(apache::thrift::RpcOptions* rpcOptions) { auto header = std::make_shared( apache::thrift::transport::THeader::ALLOW_BIG_FRAMES); header->setProtocolId(channel_->getProtocolId()); if (rpcOptions) { header->setHeaders(rpcOptions->releaseWriteHeaders()); } auto ctx = apache::thrift::ContextStack::createWithClientContext( handlers_, interceptors_, getServiceName(), "SinkService.methodThrow", *header); return {std::move(ctx), std::move(header)}; } #if FOLLY_HAS_COROUTINES folly::coro::Task> apache::thrift::Client<::cpp2::SinkService>::co_methodThrow() { ::apache::thrift::RpcOptions rpcOptions; co_return co_await co_methodThrow(rpcOptions); } folly::coro::Task> apache::thrift::Client<::cpp2::SinkService>::co_methodThrow(apache::thrift::RpcOptions& rpcOptions) { const folly::CancellationToken& cancelToken = co_await folly::coro::co_current_cancellation_token; const bool cancellable = cancelToken.canBeCancelled(); apache::thrift::ClientReceiveState returnState; apache::thrift::ClientCoroCallback callback(&returnState, co_await folly::coro::co_current_executor); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto [ctx, header] = methodThrowCtx(&rpcOptions); using CancellableCallback = apache::thrift::CancellableRequestClientCallback; auto cancellableCallback = cancellable ? CancellableCallback::create(&callback, channel_) : nullptr; auto wrappedCallback = apache::thrift::createSinkClientCallback( apache::thrift::RequestClientCallback::Ptr(apache::thrift::RequestClientCallback::Ptr(cancellableCallback ? (apache::thrift::RequestClientCallback*)cancellableCallback.get() : &callback))); fbthrift_serialize_and_send_methodThrow(rpcOptions, std::move(header), ctx.get(), wrappedCallback); if (cancellable) { folly::CancellationCallback cb(cancelToken, [&] { CancellableCallback::cancel(std::move(cancellableCallback)); }); co_await callback.co_waitUntilDone(); } else { co_await callback.co_waitUntilDone(); } if (returnState.isException()) { co_yield folly::coro::co_error(std::move(returnState.exception())); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctx)); co_return recv_methodThrow(returnState); } #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::SinkService>::recv_wrapped_methodThrow(apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse>& _return, ::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } if (!state.hasResponseBuffer()) { return folly::make_exception_wrapper("recv_ called without result"); } using result = ::cpp2::SinkService_methodThrow_presult; using ExMapType = apache::thrift::detail::ap::EmptyExMapType; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, state.extractSink(), _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, state.extractSink(), _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse> apache::thrift::Client<::cpp2::SinkService>::recv_methodThrow(::apache::thrift::ClientReceiveState& state) { apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse> _return; auto ew = recv_wrapped_methodThrow(_return, state); if (ew) { ew.throw_exception(); } return _return; } apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse> apache::thrift::Client<::cpp2::SinkService>::recv_instance_methodThrow(::apache::thrift::ClientReceiveState& state) { return recv_methodThrow(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::SinkService>::recv_instance_wrapped_methodThrow(apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse>& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_methodThrow(_return, state); } void apache::thrift::Client<::cpp2::SinkService>::fbthrift_serialize_and_send_methodSinkThrow(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::SinkClientCallback* callback, bool stealRpcOptions) { apache::thrift::detail::ac::withProtocolWriter(apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(), [&](auto&& writer) { apache::thrift::SerializedRequest request = fbthrift_serialize_methodSinkThrow(&writer, rpcOptions, *header, contextStack); if (stealRpcOptions) { fbthrift_send_methodSinkThrow(std::move(request), std::move(rpcOptions), std::move(header), std::move(callback)); } else { fbthrift_send_methodSinkThrow(std::move(request), rpcOptions, std::move(header), std::move(callback)); } }); } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::cpp2::SinkService>::methodSinkThrowCtx(apache::thrift::RpcOptions* rpcOptions) { auto header = std::make_shared( apache::thrift::transport::THeader::ALLOW_BIG_FRAMES); header->setProtocolId(channel_->getProtocolId()); if (rpcOptions) { header->setHeaders(rpcOptions->releaseWriteHeaders()); } auto ctx = apache::thrift::ContextStack::createWithClientContext( handlers_, interceptors_, getServiceName(), "SinkService.methodSinkThrow", *header); return {std::move(ctx), std::move(header)}; } #if FOLLY_HAS_COROUTINES folly::coro::Task> apache::thrift::Client<::cpp2::SinkService>::co_methodSinkThrow() { ::apache::thrift::RpcOptions rpcOptions; co_return co_await co_methodSinkThrow(rpcOptions); } folly::coro::Task> apache::thrift::Client<::cpp2::SinkService>::co_methodSinkThrow(apache::thrift::RpcOptions& rpcOptions) { const folly::CancellationToken& cancelToken = co_await folly::coro::co_current_cancellation_token; const bool cancellable = cancelToken.canBeCancelled(); apache::thrift::ClientReceiveState returnState; apache::thrift::ClientCoroCallback callback(&returnState, co_await folly::coro::co_current_executor); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto [ctx, header] = methodSinkThrowCtx(&rpcOptions); using CancellableCallback = apache::thrift::CancellableRequestClientCallback; auto cancellableCallback = cancellable ? CancellableCallback::create(&callback, channel_) : nullptr; auto wrappedCallback = apache::thrift::createSinkClientCallback( apache::thrift::RequestClientCallback::Ptr(apache::thrift::RequestClientCallback::Ptr(cancellableCallback ? (apache::thrift::RequestClientCallback*)cancellableCallback.get() : &callback))); fbthrift_serialize_and_send_methodSinkThrow(rpcOptions, std::move(header), ctx.get(), wrappedCallback); if (cancellable) { folly::CancellationCallback cb(cancelToken, [&] { CancellableCallback::cancel(std::move(cancellableCallback)); }); co_await callback.co_waitUntilDone(); } else { co_await callback.co_waitUntilDone(); } if (returnState.isException()) { co_yield folly::coro::co_error(std::move(returnState.exception())); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctx)); co_return recv_methodSinkThrow(returnState); } #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::SinkService>::recv_wrapped_methodSinkThrow(apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse>& _return, ::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } if (!state.hasResponseBuffer()) { return folly::make_exception_wrapper("recv_ called without result"); } using result = ::cpp2::SinkService_methodSinkThrow_presult; struct ExMapType { bool operator()(typename result::SinkPResultType& res, folly::exception_wrapper ew) { if (ew.with_exception([&]( ::cpp2::SinkException1& e) { res.get<1>().ref() = e; res.setIsSet(1, true); })) { return true; } return false; } }; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, state.extractSink(), _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, state.extractSink(), _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse> apache::thrift::Client<::cpp2::SinkService>::recv_methodSinkThrow(::apache::thrift::ClientReceiveState& state) { apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse> _return; auto ew = recv_wrapped_methodSinkThrow(_return, state); if (ew) { ew.throw_exception(); } return _return; } apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse> apache::thrift::Client<::cpp2::SinkService>::recv_instance_methodSinkThrow(::apache::thrift::ClientReceiveState& state) { return recv_methodSinkThrow(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::SinkService>::recv_instance_wrapped_methodSinkThrow(apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse>& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_methodSinkThrow(_return, state); } void apache::thrift::Client<::cpp2::SinkService>::fbthrift_serialize_and_send_methodFinalThrow(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::SinkClientCallback* callback, bool stealRpcOptions) { apache::thrift::detail::ac::withProtocolWriter(apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(), [&](auto&& writer) { apache::thrift::SerializedRequest request = fbthrift_serialize_methodFinalThrow(&writer, rpcOptions, *header, contextStack); if (stealRpcOptions) { fbthrift_send_methodFinalThrow(std::move(request), std::move(rpcOptions), std::move(header), std::move(callback)); } else { fbthrift_send_methodFinalThrow(std::move(request), rpcOptions, std::move(header), std::move(callback)); } }); } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::cpp2::SinkService>::methodFinalThrowCtx(apache::thrift::RpcOptions* rpcOptions) { auto header = std::make_shared( apache::thrift::transport::THeader::ALLOW_BIG_FRAMES); header->setProtocolId(channel_->getProtocolId()); if (rpcOptions) { header->setHeaders(rpcOptions->releaseWriteHeaders()); } auto ctx = apache::thrift::ContextStack::createWithClientContext( handlers_, interceptors_, getServiceName(), "SinkService.methodFinalThrow", *header); return {std::move(ctx), std::move(header)}; } #if FOLLY_HAS_COROUTINES folly::coro::Task> apache::thrift::Client<::cpp2::SinkService>::co_methodFinalThrow() { ::apache::thrift::RpcOptions rpcOptions; co_return co_await co_methodFinalThrow(rpcOptions); } folly::coro::Task> apache::thrift::Client<::cpp2::SinkService>::co_methodFinalThrow(apache::thrift::RpcOptions& rpcOptions) { const folly::CancellationToken& cancelToken = co_await folly::coro::co_current_cancellation_token; const bool cancellable = cancelToken.canBeCancelled(); apache::thrift::ClientReceiveState returnState; apache::thrift::ClientCoroCallback callback(&returnState, co_await folly::coro::co_current_executor); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto [ctx, header] = methodFinalThrowCtx(&rpcOptions); using CancellableCallback = apache::thrift::CancellableRequestClientCallback; auto cancellableCallback = cancellable ? CancellableCallback::create(&callback, channel_) : nullptr; auto wrappedCallback = apache::thrift::createSinkClientCallback( apache::thrift::RequestClientCallback::Ptr(apache::thrift::RequestClientCallback::Ptr(cancellableCallback ? (apache::thrift::RequestClientCallback*)cancellableCallback.get() : &callback))); fbthrift_serialize_and_send_methodFinalThrow(rpcOptions, std::move(header), ctx.get(), wrappedCallback); if (cancellable) { folly::CancellationCallback cb(cancelToken, [&] { CancellableCallback::cancel(std::move(cancellableCallback)); }); co_await callback.co_waitUntilDone(); } else { co_await callback.co_waitUntilDone(); } if (returnState.isException()) { co_yield folly::coro::co_error(std::move(returnState.exception())); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctx)); co_return recv_methodFinalThrow(returnState); } #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::SinkService>::recv_wrapped_methodFinalThrow(apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse>& _return, ::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } if (!state.hasResponseBuffer()) { return folly::make_exception_wrapper("recv_ called without result"); } using result = ::cpp2::SinkService_methodFinalThrow_presult; using ExMapType = apache::thrift::detail::ap::EmptyExMapType; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, state.extractSink(), _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, state.extractSink(), _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse> apache::thrift::Client<::cpp2::SinkService>::recv_methodFinalThrow(::apache::thrift::ClientReceiveState& state) { apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse> _return; auto ew = recv_wrapped_methodFinalThrow(_return, state); if (ew) { ew.throw_exception(); } return _return; } apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse> apache::thrift::Client<::cpp2::SinkService>::recv_instance_methodFinalThrow(::apache::thrift::ClientReceiveState& state) { return recv_methodFinalThrow(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::SinkService>::recv_instance_wrapped_methodFinalThrow(apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse>& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_methodFinalThrow(_return, state); } void apache::thrift::Client<::cpp2::SinkService>::fbthrift_serialize_and_send_methodBothThrow(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::SinkClientCallback* callback, bool stealRpcOptions) { apache::thrift::detail::ac::withProtocolWriter(apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(), [&](auto&& writer) { apache::thrift::SerializedRequest request = fbthrift_serialize_methodBothThrow(&writer, rpcOptions, *header, contextStack); if (stealRpcOptions) { fbthrift_send_methodBothThrow(std::move(request), std::move(rpcOptions), std::move(header), std::move(callback)); } else { fbthrift_send_methodBothThrow(std::move(request), rpcOptions, std::move(header), std::move(callback)); } }); } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::cpp2::SinkService>::methodBothThrowCtx(apache::thrift::RpcOptions* rpcOptions) { auto header = std::make_shared( apache::thrift::transport::THeader::ALLOW_BIG_FRAMES); header->setProtocolId(channel_->getProtocolId()); if (rpcOptions) { header->setHeaders(rpcOptions->releaseWriteHeaders()); } auto ctx = apache::thrift::ContextStack::createWithClientContext( handlers_, interceptors_, getServiceName(), "SinkService.methodBothThrow", *header); return {std::move(ctx), std::move(header)}; } #if FOLLY_HAS_COROUTINES folly::coro::Task> apache::thrift::Client<::cpp2::SinkService>::co_methodBothThrow() { ::apache::thrift::RpcOptions rpcOptions; co_return co_await co_methodBothThrow(rpcOptions); } folly::coro::Task> apache::thrift::Client<::cpp2::SinkService>::co_methodBothThrow(apache::thrift::RpcOptions& rpcOptions) { const folly::CancellationToken& cancelToken = co_await folly::coro::co_current_cancellation_token; const bool cancellable = cancelToken.canBeCancelled(); apache::thrift::ClientReceiveState returnState; apache::thrift::ClientCoroCallback callback(&returnState, co_await folly::coro::co_current_executor); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto [ctx, header] = methodBothThrowCtx(&rpcOptions); using CancellableCallback = apache::thrift::CancellableRequestClientCallback; auto cancellableCallback = cancellable ? CancellableCallback::create(&callback, channel_) : nullptr; auto wrappedCallback = apache::thrift::createSinkClientCallback( apache::thrift::RequestClientCallback::Ptr(apache::thrift::RequestClientCallback::Ptr(cancellableCallback ? (apache::thrift::RequestClientCallback*)cancellableCallback.get() : &callback))); fbthrift_serialize_and_send_methodBothThrow(rpcOptions, std::move(header), ctx.get(), wrappedCallback); if (cancellable) { folly::CancellationCallback cb(cancelToken, [&] { CancellableCallback::cancel(std::move(cancellableCallback)); }); co_await callback.co_waitUntilDone(); } else { co_await callback.co_waitUntilDone(); } if (returnState.isException()) { co_yield folly::coro::co_error(std::move(returnState.exception())); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctx)); co_return recv_methodBothThrow(returnState); } #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::SinkService>::recv_wrapped_methodBothThrow(apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse>& _return, ::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } if (!state.hasResponseBuffer()) { return folly::make_exception_wrapper("recv_ called without result"); } using result = ::cpp2::SinkService_methodBothThrow_presult; struct ExMapType { bool operator()(typename result::SinkPResultType& res, folly::exception_wrapper ew) { if (ew.with_exception([&]( ::cpp2::SinkException1& e) { res.get<1>().ref() = e; res.setIsSet(1, true); })) { return true; } return false; } }; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, state.extractSink(), _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, state.extractSink(), _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse> apache::thrift::Client<::cpp2::SinkService>::recv_methodBothThrow(::apache::thrift::ClientReceiveState& state) { apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse> _return; auto ew = recv_wrapped_methodBothThrow(_return, state); if (ew) { ew.throw_exception(); } return _return; } apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse> apache::thrift::Client<::cpp2::SinkService>::recv_instance_methodBothThrow(::apache::thrift::ClientReceiveState& state) { return recv_methodBothThrow(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::SinkService>::recv_instance_wrapped_methodBothThrow(apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse>& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_methodBothThrow(_return, state); } void apache::thrift::Client<::cpp2::SinkService>::fbthrift_serialize_and_send_methodFast(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::SinkClientCallback* callback, bool stealRpcOptions) { apache::thrift::detail::ac::withProtocolWriter(apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(), [&](auto&& writer) { apache::thrift::SerializedRequest request = fbthrift_serialize_methodFast(&writer, rpcOptions, *header, contextStack); if (stealRpcOptions) { fbthrift_send_methodFast(std::move(request), std::move(rpcOptions), std::move(header), std::move(callback)); } else { fbthrift_send_methodFast(std::move(request), rpcOptions, std::move(header), std::move(callback)); } }); } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::cpp2::SinkService>::methodFastCtx(apache::thrift::RpcOptions* rpcOptions) { auto header = std::make_shared( apache::thrift::transport::THeader::ALLOW_BIG_FRAMES); header->setProtocolId(channel_->getProtocolId()); if (rpcOptions) { header->setHeaders(rpcOptions->releaseWriteHeaders()); } auto ctx = apache::thrift::ContextStack::createWithClientContext( handlers_, interceptors_, getServiceName(), "SinkService.methodFast", *header); return {std::move(ctx), std::move(header)}; } #if FOLLY_HAS_COROUTINES folly::coro::Task> apache::thrift::Client<::cpp2::SinkService>::co_methodFast() { ::apache::thrift::RpcOptions rpcOptions; co_return co_await co_methodFast(rpcOptions); } folly::coro::Task> apache::thrift::Client<::cpp2::SinkService>::co_methodFast(apache::thrift::RpcOptions& rpcOptions) { const folly::CancellationToken& cancelToken = co_await folly::coro::co_current_cancellation_token; const bool cancellable = cancelToken.canBeCancelled(); apache::thrift::ClientReceiveState returnState; apache::thrift::ClientCoroCallback callback(&returnState, co_await folly::coro::co_current_executor); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto [ctx, header] = methodFastCtx(&rpcOptions); using CancellableCallback = apache::thrift::CancellableRequestClientCallback; auto cancellableCallback = cancellable ? CancellableCallback::create(&callback, channel_) : nullptr; auto wrappedCallback = apache::thrift::createSinkClientCallback( apache::thrift::RequestClientCallback::Ptr(apache::thrift::RequestClientCallback::Ptr(cancellableCallback ? (apache::thrift::RequestClientCallback*)cancellableCallback.get() : &callback))); fbthrift_serialize_and_send_methodFast(rpcOptions, std::move(header), ctx.get(), wrappedCallback); if (cancellable) { folly::CancellationCallback cb(cancelToken, [&] { CancellableCallback::cancel(std::move(cancellableCallback)); }); co_await callback.co_waitUntilDone(); } else { co_await callback.co_waitUntilDone(); } if (returnState.isException()) { co_yield folly::coro::co_error(std::move(returnState.exception())); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctx)); co_return recv_methodFast(returnState); } #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::SinkService>::recv_wrapped_methodFast(apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse>& _return, ::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } if (!state.hasResponseBuffer()) { return folly::make_exception_wrapper("recv_ called without result"); } using result = ::cpp2::SinkService_methodFast_presult; using ExMapType = apache::thrift::detail::ap::EmptyExMapType; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, state.extractSink(), _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, state.extractSink(), _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse> apache::thrift::Client<::cpp2::SinkService>::recv_methodFast(::apache::thrift::ClientReceiveState& state) { apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse> _return; auto ew = recv_wrapped_methodFast(_return, state); if (ew) { ew.throw_exception(); } return _return; } apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse> apache::thrift::Client<::cpp2::SinkService>::recv_instance_methodFast(::apache::thrift::ClientReceiveState& state) { return recv_methodFast(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::SinkService>::recv_instance_wrapped_methodFast(apache::thrift::ClientSink<::cpp2::SinkPayload, ::cpp2::FinalResponse>& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_methodFast(_return, state); }