/** * Autogenerated by Thrift for thrift/compiler/test/fixtures/stream/src/module.thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @nocommit */ #include "thrift/compiler/test/fixtures/stream/gen-cpp2/PubSubStreamingServiceAsyncClient.h" #include namespace cpp2 { typedef apache::thrift::ThriftPresult, apache::thrift::FieldData<2, ::apache::thrift::type_class::integral, ::std::int32_t*>> PubSubStreamingService_returnstream_pargs; typedef apache::thrift::ThriftPResultStream< apache::thrift::ThriftPresult, apache::thrift::ThriftPresult> > PubSubStreamingService_returnstream_presult; typedef apache::thrift::ThriftPresult> PubSubStreamingService_streamthrows_pargs; typedef apache::thrift::ThriftPResultStream< apache::thrift::ThriftPresult, apache::thrift::ThriftPresult, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::cpp2::FooStreamEx>> > PubSubStreamingService_streamthrows_presult; typedef apache::thrift::ThriftPresult> PubSubStreamingService_servicethrows_pargs; typedef apache::thrift::ThriftPResultStream< apache::thrift::ThriftPresult>, apache::thrift::ThriftPresult> > PubSubStreamingService_servicethrows_presult; typedef apache::thrift::ThriftPresult> PubSubStreamingService_servicethrows2_pargs; typedef apache::thrift::ThriftPResultStream< apache::thrift::ThriftPresult, apache::thrift::FieldData<2, ::apache::thrift::type_class::structure, ::cpp2::FooEx2>>, apache::thrift::ThriftPresult> > PubSubStreamingService_servicethrows2_presult; typedef apache::thrift::ThriftPresult> PubSubStreamingService_boththrows_pargs; typedef apache::thrift::ThriftPResultStream< apache::thrift::ThriftPresult>, apache::thrift::ThriftPresult, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::cpp2::FooStreamEx>> > PubSubStreamingService_boththrows_presult; typedef apache::thrift::ThriftPresult> PubSubStreamingService_responseandstreamstreamthrows_pargs; typedef apache::thrift::ThriftPResultStream< apache::thrift::ThriftPresult>, apache::thrift::ThriftPresult, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::cpp2::FooStreamEx>> > PubSubStreamingService_responseandstreamstreamthrows_presult; typedef apache::thrift::ThriftPresult> PubSubStreamingService_responseandstreamservicethrows_pargs; typedef apache::thrift::ThriftPResultStream< apache::thrift::ThriftPresult, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::cpp2::FooEx>>, apache::thrift::ThriftPresult> > PubSubStreamingService_responseandstreamservicethrows_presult; typedef apache::thrift::ThriftPresult> PubSubStreamingService_responseandstreamboththrows_pargs; typedef apache::thrift::ThriftPResultStream< apache::thrift::ThriftPresult, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::cpp2::FooEx>>, apache::thrift::ThriftPresult, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::cpp2::FooStreamEx>> > PubSubStreamingService_responseandstreamboththrows_presult; typedef apache::thrift::ThriftPresult, apache::thrift::FieldData<2, ::apache::thrift::type_class::integral, ::std::int32_t*>> PubSubStreamingService_returnstreamFast_pargs; typedef apache::thrift::ThriftPResultStream< apache::thrift::ThriftPresult, apache::thrift::ThriftPresult> > PubSubStreamingService_returnstreamFast_presult; } // namespace cpp2 template void apache::thrift::Client<::cpp2::PubSubStreamingService>::returnstreamT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_i32_from, ::std::int32_t p_i32_to) { ::cpp2::PubSubStreamingService_returnstream_pargs args; args.get<0>().value = &p_i32_from; args.get<1>().value = &p_i32_to; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "returnstream", ::apache::thrift::FunctionQualifier::Unspecified, "PubSubStreamingService"); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } template void apache::thrift::Client<::cpp2::PubSubStreamingService>::streamthrowsT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo) { ::cpp2::PubSubStreamingService_streamthrows_pargs args; args.get<0>().value = &p_foo; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "streamthrows", ::apache::thrift::FunctionQualifier::Unspecified, "PubSubStreamingService"); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } template void apache::thrift::Client<::cpp2::PubSubStreamingService>::servicethrowsT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo) { ::cpp2::PubSubStreamingService_servicethrows_pargs args; args.get<0>().value = &p_foo; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "servicethrows", ::apache::thrift::FunctionQualifier::Unspecified, "PubSubStreamingService"); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } template void apache::thrift::Client<::cpp2::PubSubStreamingService>::servicethrows2T(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo) { ::cpp2::PubSubStreamingService_servicethrows2_pargs args; args.get<0>().value = &p_foo; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "servicethrows2", ::apache::thrift::FunctionQualifier::Unspecified, "PubSubStreamingService"); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } template void apache::thrift::Client<::cpp2::PubSubStreamingService>::boththrowsT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo) { ::cpp2::PubSubStreamingService_boththrows_pargs args; args.get<0>().value = &p_foo; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "boththrows", ::apache::thrift::FunctionQualifier::Unspecified, "PubSubStreamingService"); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } template void apache::thrift::Client<::cpp2::PubSubStreamingService>::responseandstreamstreamthrowsT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo) { ::cpp2::PubSubStreamingService_responseandstreamstreamthrows_pargs args; args.get<0>().value = &p_foo; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "responseandstreamstreamthrows", ::apache::thrift::FunctionQualifier::Unspecified, "PubSubStreamingService"); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } template void apache::thrift::Client<::cpp2::PubSubStreamingService>::responseandstreamservicethrowsT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo) { ::cpp2::PubSubStreamingService_responseandstreamservicethrows_pargs args; args.get<0>().value = &p_foo; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "responseandstreamservicethrows", ::apache::thrift::FunctionQualifier::Unspecified, "PubSubStreamingService"); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } template void apache::thrift::Client<::cpp2::PubSubStreamingService>::responseandstreamboththrowsT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo) { ::cpp2::PubSubStreamingService_responseandstreamboththrows_pargs args; args.get<0>().value = &p_foo; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "responseandstreamboththrows", ::apache::thrift::FunctionQualifier::Unspecified, "PubSubStreamingService"); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } template void apache::thrift::Client<::cpp2::PubSubStreamingService>::returnstreamFastT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_i32_from, ::std::int32_t p_i32_to) { ::cpp2::PubSubStreamingService_returnstreamFast_pargs args; args.get<0>().value = &p_i32_from; args.get<1>().value = &p_i32_to; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "returnstreamFast", ::apache::thrift::FunctionQualifier::Unspecified, "PubSubStreamingService"); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::returnstream(std::unique_ptr callback, ::std::int32_t p_i32_from, ::std::int32_t p_i32_to) { ::apache::thrift::RpcOptions rpcOptions; returnstream(rpcOptions, std::move(callback), p_i32_from, p_i32_to); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::returnstream(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, ::std::int32_t p_i32_from, ::std::int32_t p_i32_to) { auto [ctx, header] = returnstreamCtx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::createStreamClientCallback( apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)), rpcOptions.getBufferOptions()); returnstreamImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback), p_i32_from, p_i32_to); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::returnstreamImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_i32_from, ::std::int32_t p_i32_to, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { returnstreamT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_i32_from, p_i32_to); } else { returnstreamT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_i32_from, p_i32_to); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { returnstreamT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_i32_from, p_i32_to); } else { returnstreamT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_i32_from, p_i32_to); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::cpp2::PubSubStreamingService>::returnstreamCtx(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_, getServiceName(), "PubSubStreamingService.returnstream", *header); return {std::move(ctx), std::move(header)}; } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::sync_returnstream(::std::int32_t p_i32_from, ::std::int32_t p_i32_to) { ::apache::thrift::RpcOptions rpcOptions; return sync_returnstream(rpcOptions, p_i32_from, p_i32_to); } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::sync_returnstream(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_i32_from, ::std::int32_t p_i32_to) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = returnstreamCtx(&rpcOptions); auto wrappedCallback = apache::thrift::createStreamClientCallback( apache::thrift::RequestClientCallback::Ptr(&callback), rpcOptions.getBufferOptions()); callback.waitUntilDone( evb, [&] { returnstreamImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback), p_i32_from, p_i32_to); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { return recv_returnstream(returnState); }); } folly::SemiFuture> apache::thrift::Client<::cpp2::PubSubStreamingService>::semifuture_returnstream(::std::int32_t p_i32_from, ::std::int32_t p_i32_to) { ::apache::thrift::RpcOptions rpcOptions; return semifuture_returnstream(rpcOptions, p_i32_from, p_i32_to); } folly::SemiFuture> apache::thrift::Client<::cpp2::PubSubStreamingService>::semifuture_returnstream(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_i32_from, ::std::int32_t p_i32_to) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_returnstream, channel_); auto callback = std::move(callbackAndFuture.first); returnstream(rpcOptions, std::move(callback), p_i32_from, p_i32_to); return std::move(callbackAndFuture.second); } folly::SemiFuture, std::unique_ptr>> apache::thrift::Client<::cpp2::PubSubStreamingService>::header_semifuture_returnstream(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_i32_from, ::std::int32_t p_i32_to) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_returnstream, channel_); auto callback = std::move(callbackAndFuture.first); returnstream(rpcOptions, std::move(callback), p_i32_from, p_i32_to); return std::move(callbackAndFuture.second); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_wrapped_returnstream(apache::thrift::ClientBufferedStream<::std::int32_t>& _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::PubSubStreamingService_returnstream_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_returnstream(::apache::thrift::ClientReceiveState& state) { apache::thrift::ClientBufferedStream<::std::int32_t> _return; auto ew = recv_wrapped_returnstream(_return, state); if (ew) { ew.throw_exception(); } return _return; } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_instance_returnstream(::apache::thrift::ClientReceiveState& state) { return recv_returnstream(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_instance_wrapped_returnstream(apache::thrift::ClientBufferedStream<::std::int32_t>& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_returnstream(_return, state); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::streamthrows(std::unique_ptr callback, ::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; streamthrows(rpcOptions, std::move(callback), p_foo); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::streamthrows(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, ::std::int32_t p_foo) { auto [ctx, header] = streamthrowsCtx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::createStreamClientCallback( apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)), rpcOptions.getBufferOptions()); streamthrowsImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback), p_foo); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::streamthrowsImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { streamthrowsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_foo); } else { streamthrowsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_foo); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { streamthrowsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_foo); } else { streamthrowsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_foo); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::cpp2::PubSubStreamingService>::streamthrowsCtx(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_, getServiceName(), "PubSubStreamingService.streamthrows", *header); return {std::move(ctx), std::move(header)}; } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::sync_streamthrows(::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; return sync_streamthrows(rpcOptions, p_foo); } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::sync_streamthrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = streamthrowsCtx(&rpcOptions); auto wrappedCallback = apache::thrift::createStreamClientCallback( apache::thrift::RequestClientCallback::Ptr(&callback), rpcOptions.getBufferOptions()); callback.waitUntilDone( evb, [&] { streamthrowsImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback), p_foo); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { return recv_streamthrows(returnState); }); } folly::SemiFuture> apache::thrift::Client<::cpp2::PubSubStreamingService>::semifuture_streamthrows(::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; return semifuture_streamthrows(rpcOptions, p_foo); } folly::SemiFuture> apache::thrift::Client<::cpp2::PubSubStreamingService>::semifuture_streamthrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_streamthrows, channel_); auto callback = std::move(callbackAndFuture.first); streamthrows(rpcOptions, std::move(callback), p_foo); return std::move(callbackAndFuture.second); } folly::SemiFuture, std::unique_ptr>> apache::thrift::Client<::cpp2::PubSubStreamingService>::header_semifuture_streamthrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_streamthrows, channel_); auto callback = std::move(callbackAndFuture.first); streamthrows(rpcOptions, std::move(callback), p_foo); return std::move(callbackAndFuture.second); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_wrapped_streamthrows(apache::thrift::ClientBufferedStream<::std::int32_t>& _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::PubSubStreamingService_streamthrows_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_streamthrows(::apache::thrift::ClientReceiveState& state) { apache::thrift::ClientBufferedStream<::std::int32_t> _return; auto ew = recv_wrapped_streamthrows(_return, state); if (ew) { ew.throw_exception(); } return _return; } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_instance_streamthrows(::apache::thrift::ClientReceiveState& state) { return recv_streamthrows(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_instance_wrapped_streamthrows(apache::thrift::ClientBufferedStream<::std::int32_t>& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_streamthrows(_return, state); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::servicethrows(std::unique_ptr callback, ::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; servicethrows(rpcOptions, std::move(callback), p_foo); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::servicethrows(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, ::std::int32_t p_foo) { auto [ctx, header] = servicethrowsCtx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::createStreamClientCallback( apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)), rpcOptions.getBufferOptions()); servicethrowsImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback), p_foo); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::servicethrowsImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { servicethrowsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_foo); } else { servicethrowsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_foo); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { servicethrowsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_foo); } else { servicethrowsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_foo); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::cpp2::PubSubStreamingService>::servicethrowsCtx(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_, getServiceName(), "PubSubStreamingService.servicethrows", *header); return {std::move(ctx), std::move(header)}; } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::sync_servicethrows(::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; return sync_servicethrows(rpcOptions, p_foo); } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::sync_servicethrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = servicethrowsCtx(&rpcOptions); auto wrappedCallback = apache::thrift::createStreamClientCallback( apache::thrift::RequestClientCallback::Ptr(&callback), rpcOptions.getBufferOptions()); callback.waitUntilDone( evb, [&] { servicethrowsImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback), p_foo); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { return recv_servicethrows(returnState); }); } folly::SemiFuture> apache::thrift::Client<::cpp2::PubSubStreamingService>::semifuture_servicethrows(::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; return semifuture_servicethrows(rpcOptions, p_foo); } folly::SemiFuture> apache::thrift::Client<::cpp2::PubSubStreamingService>::semifuture_servicethrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_servicethrows, channel_); auto callback = std::move(callbackAndFuture.first); servicethrows(rpcOptions, std::move(callback), p_foo); return std::move(callbackAndFuture.second); } folly::SemiFuture, std::unique_ptr>> apache::thrift::Client<::cpp2::PubSubStreamingService>::header_semifuture_servicethrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_servicethrows, channel_); auto callback = std::move(callbackAndFuture.first); servicethrows(rpcOptions, std::move(callback), p_foo); return std::move(callbackAndFuture.second); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_wrapped_servicethrows(apache::thrift::ClientBufferedStream<::std::int32_t>& _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::PubSubStreamingService_servicethrows_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_servicethrows(::apache::thrift::ClientReceiveState& state) { apache::thrift::ClientBufferedStream<::std::int32_t> _return; auto ew = recv_wrapped_servicethrows(_return, state); if (ew) { ew.throw_exception(); } return _return; } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_instance_servicethrows(::apache::thrift::ClientReceiveState& state) { return recv_servicethrows(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_instance_wrapped_servicethrows(apache::thrift::ClientBufferedStream<::std::int32_t>& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_servicethrows(_return, state); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::servicethrows2(std::unique_ptr callback, ::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; servicethrows2(rpcOptions, std::move(callback), p_foo); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::servicethrows2(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, ::std::int32_t p_foo) { auto [ctx, header] = servicethrows2Ctx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::createStreamClientCallback( apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)), rpcOptions.getBufferOptions()); servicethrows2Impl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback), p_foo); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::servicethrows2Impl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { servicethrows2T(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_foo); } else { servicethrows2T(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_foo); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { servicethrows2T(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_foo); } else { servicethrows2T(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_foo); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::cpp2::PubSubStreamingService>::servicethrows2Ctx(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_, getServiceName(), "PubSubStreamingService.servicethrows2", *header); return {std::move(ctx), std::move(header)}; } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::sync_servicethrows2(::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; return sync_servicethrows2(rpcOptions, p_foo); } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::sync_servicethrows2(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = servicethrows2Ctx(&rpcOptions); auto wrappedCallback = apache::thrift::createStreamClientCallback( apache::thrift::RequestClientCallback::Ptr(&callback), rpcOptions.getBufferOptions()); callback.waitUntilDone( evb, [&] { servicethrows2Impl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback), p_foo); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { return recv_servicethrows2(returnState); }); } folly::SemiFuture> apache::thrift::Client<::cpp2::PubSubStreamingService>::semifuture_servicethrows2(::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; return semifuture_servicethrows2(rpcOptions, p_foo); } folly::SemiFuture> apache::thrift::Client<::cpp2::PubSubStreamingService>::semifuture_servicethrows2(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_servicethrows2, channel_); auto callback = std::move(callbackAndFuture.first); servicethrows2(rpcOptions, std::move(callback), p_foo); return std::move(callbackAndFuture.second); } folly::SemiFuture, std::unique_ptr>> apache::thrift::Client<::cpp2::PubSubStreamingService>::header_semifuture_servicethrows2(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_servicethrows2, channel_); auto callback = std::move(callbackAndFuture.first); servicethrows2(rpcOptions, std::move(callback), p_foo); return std::move(callbackAndFuture.second); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_wrapped_servicethrows2(apache::thrift::ClientBufferedStream<::std::int32_t>& _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::PubSubStreamingService_servicethrows2_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_servicethrows2(::apache::thrift::ClientReceiveState& state) { apache::thrift::ClientBufferedStream<::std::int32_t> _return; auto ew = recv_wrapped_servicethrows2(_return, state); if (ew) { ew.throw_exception(); } return _return; } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_instance_servicethrows2(::apache::thrift::ClientReceiveState& state) { return recv_servicethrows2(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_instance_wrapped_servicethrows2(apache::thrift::ClientBufferedStream<::std::int32_t>& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_servicethrows2(_return, state); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::boththrows(std::unique_ptr callback, ::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; boththrows(rpcOptions, std::move(callback), p_foo); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::boththrows(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, ::std::int32_t p_foo) { auto [ctx, header] = boththrowsCtx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::createStreamClientCallback( apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)), rpcOptions.getBufferOptions()); boththrowsImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback), p_foo); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::boththrowsImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { boththrowsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_foo); } else { boththrowsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_foo); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { boththrowsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_foo); } else { boththrowsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_foo); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::cpp2::PubSubStreamingService>::boththrowsCtx(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_, getServiceName(), "PubSubStreamingService.boththrows", *header); return {std::move(ctx), std::move(header)}; } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::sync_boththrows(::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; return sync_boththrows(rpcOptions, p_foo); } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::sync_boththrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = boththrowsCtx(&rpcOptions); auto wrappedCallback = apache::thrift::createStreamClientCallback( apache::thrift::RequestClientCallback::Ptr(&callback), rpcOptions.getBufferOptions()); callback.waitUntilDone( evb, [&] { boththrowsImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback), p_foo); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { return recv_boththrows(returnState); }); } folly::SemiFuture> apache::thrift::Client<::cpp2::PubSubStreamingService>::semifuture_boththrows(::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; return semifuture_boththrows(rpcOptions, p_foo); } folly::SemiFuture> apache::thrift::Client<::cpp2::PubSubStreamingService>::semifuture_boththrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_boththrows, channel_); auto callback = std::move(callbackAndFuture.first); boththrows(rpcOptions, std::move(callback), p_foo); return std::move(callbackAndFuture.second); } folly::SemiFuture, std::unique_ptr>> apache::thrift::Client<::cpp2::PubSubStreamingService>::header_semifuture_boththrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_boththrows, channel_); auto callback = std::move(callbackAndFuture.first); boththrows(rpcOptions, std::move(callback), p_foo); return std::move(callbackAndFuture.second); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_wrapped_boththrows(apache::thrift::ClientBufferedStream<::std::int32_t>& _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::PubSubStreamingService_boththrows_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_boththrows(::apache::thrift::ClientReceiveState& state) { apache::thrift::ClientBufferedStream<::std::int32_t> _return; auto ew = recv_wrapped_boththrows(_return, state); if (ew) { ew.throw_exception(); } return _return; } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_instance_boththrows(::apache::thrift::ClientReceiveState& state) { return recv_boththrows(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_instance_wrapped_boththrows(apache::thrift::ClientBufferedStream<::std::int32_t>& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_boththrows(_return, state); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::responseandstreamstreamthrows(std::unique_ptr callback, ::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; responseandstreamstreamthrows(rpcOptions, std::move(callback), p_foo); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::responseandstreamstreamthrows(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, ::std::int32_t p_foo) { auto [ctx, header] = responseandstreamstreamthrowsCtx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::createStreamClientCallback( apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)), rpcOptions.getBufferOptions()); responseandstreamstreamthrowsImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback), p_foo); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::responseandstreamstreamthrowsImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { responseandstreamstreamthrowsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_foo); } else { responseandstreamstreamthrowsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_foo); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { responseandstreamstreamthrowsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_foo); } else { responseandstreamstreamthrowsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_foo); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::cpp2::PubSubStreamingService>::responseandstreamstreamthrowsCtx(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_, getServiceName(), "PubSubStreamingService.responseandstreamstreamthrows", *header); return {std::move(ctx), std::move(header)}; } apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::sync_responseandstreamstreamthrows(::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; return sync_responseandstreamstreamthrows(rpcOptions, p_foo); } apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::sync_responseandstreamstreamthrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = responseandstreamstreamthrowsCtx(&rpcOptions); auto wrappedCallback = apache::thrift::createStreamClientCallback( apache::thrift::RequestClientCallback::Ptr(&callback), rpcOptions.getBufferOptions()); callback.waitUntilDone( evb, [&] { responseandstreamstreamthrowsImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback), p_foo); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { return recv_responseandstreamstreamthrows(returnState); }); } folly::SemiFuture> apache::thrift::Client<::cpp2::PubSubStreamingService>::semifuture_responseandstreamstreamthrows(::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; return semifuture_responseandstreamstreamthrows(rpcOptions, p_foo); } folly::SemiFuture> apache::thrift::Client<::cpp2::PubSubStreamingService>::semifuture_responseandstreamstreamthrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_responseandstreamstreamthrows, channel_); auto callback = std::move(callbackAndFuture.first); responseandstreamstreamthrows(rpcOptions, std::move(callback), p_foo); return std::move(callbackAndFuture.second); } folly::SemiFuture, std::unique_ptr>> apache::thrift::Client<::cpp2::PubSubStreamingService>::header_semifuture_responseandstreamstreamthrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_responseandstreamstreamthrows, channel_); auto callback = std::move(callbackAndFuture.first); responseandstreamstreamthrows(rpcOptions, std::move(callback), p_foo); return std::move(callbackAndFuture.second); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_wrapped_responseandstreamstreamthrows(apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t>& _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::PubSubStreamingService_responseandstreamstreamthrows_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_responseandstreamstreamthrows(::apache::thrift::ClientReceiveState& state) { apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> _return; auto ew = recv_wrapped_responseandstreamstreamthrows(_return, state); if (ew) { ew.throw_exception(); } return _return; } apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_instance_responseandstreamstreamthrows(::apache::thrift::ClientReceiveState& state) { return recv_responseandstreamstreamthrows(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_instance_wrapped_responseandstreamstreamthrows(apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t>& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_responseandstreamstreamthrows(_return, state); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::responseandstreamservicethrows(std::unique_ptr callback, ::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; responseandstreamservicethrows(rpcOptions, std::move(callback), p_foo); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::responseandstreamservicethrows(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, ::std::int32_t p_foo) { auto [ctx, header] = responseandstreamservicethrowsCtx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::createStreamClientCallback( apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)), rpcOptions.getBufferOptions()); responseandstreamservicethrowsImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback), p_foo); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::responseandstreamservicethrowsImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { responseandstreamservicethrowsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_foo); } else { responseandstreamservicethrowsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_foo); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { responseandstreamservicethrowsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_foo); } else { responseandstreamservicethrowsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_foo); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::cpp2::PubSubStreamingService>::responseandstreamservicethrowsCtx(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_, getServiceName(), "PubSubStreamingService.responseandstreamservicethrows", *header); return {std::move(ctx), std::move(header)}; } apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::sync_responseandstreamservicethrows(::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; return sync_responseandstreamservicethrows(rpcOptions, p_foo); } apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::sync_responseandstreamservicethrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = responseandstreamservicethrowsCtx(&rpcOptions); auto wrappedCallback = apache::thrift::createStreamClientCallback( apache::thrift::RequestClientCallback::Ptr(&callback), rpcOptions.getBufferOptions()); callback.waitUntilDone( evb, [&] { responseandstreamservicethrowsImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback), p_foo); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { return recv_responseandstreamservicethrows(returnState); }); } folly::SemiFuture> apache::thrift::Client<::cpp2::PubSubStreamingService>::semifuture_responseandstreamservicethrows(::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; return semifuture_responseandstreamservicethrows(rpcOptions, p_foo); } folly::SemiFuture> apache::thrift::Client<::cpp2::PubSubStreamingService>::semifuture_responseandstreamservicethrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_responseandstreamservicethrows, channel_); auto callback = std::move(callbackAndFuture.first); responseandstreamservicethrows(rpcOptions, std::move(callback), p_foo); return std::move(callbackAndFuture.second); } folly::SemiFuture, std::unique_ptr>> apache::thrift::Client<::cpp2::PubSubStreamingService>::header_semifuture_responseandstreamservicethrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_responseandstreamservicethrows, channel_); auto callback = std::move(callbackAndFuture.first); responseandstreamservicethrows(rpcOptions, std::move(callback), p_foo); return std::move(callbackAndFuture.second); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_wrapped_responseandstreamservicethrows(apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t>& _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::PubSubStreamingService_responseandstreamservicethrows_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_responseandstreamservicethrows(::apache::thrift::ClientReceiveState& state) { apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> _return; auto ew = recv_wrapped_responseandstreamservicethrows(_return, state); if (ew) { ew.throw_exception(); } return _return; } apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_instance_responseandstreamservicethrows(::apache::thrift::ClientReceiveState& state) { return recv_responseandstreamservicethrows(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_instance_wrapped_responseandstreamservicethrows(apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t>& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_responseandstreamservicethrows(_return, state); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::responseandstreamboththrows(std::unique_ptr callback, ::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; responseandstreamboththrows(rpcOptions, std::move(callback), p_foo); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::responseandstreamboththrows(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, ::std::int32_t p_foo) { auto [ctx, header] = responseandstreamboththrowsCtx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::createStreamClientCallback( apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)), rpcOptions.getBufferOptions()); responseandstreamboththrowsImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback), p_foo); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::responseandstreamboththrowsImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { responseandstreamboththrowsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_foo); } else { responseandstreamboththrowsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_foo); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { responseandstreamboththrowsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_foo); } else { responseandstreamboththrowsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_foo); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::cpp2::PubSubStreamingService>::responseandstreamboththrowsCtx(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_, getServiceName(), "PubSubStreamingService.responseandstreamboththrows", *header); return {std::move(ctx), std::move(header)}; } apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::sync_responseandstreamboththrows(::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; return sync_responseandstreamboththrows(rpcOptions, p_foo); } apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::sync_responseandstreamboththrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = responseandstreamboththrowsCtx(&rpcOptions); auto wrappedCallback = apache::thrift::createStreamClientCallback( apache::thrift::RequestClientCallback::Ptr(&callback), rpcOptions.getBufferOptions()); callback.waitUntilDone( evb, [&] { responseandstreamboththrowsImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback), p_foo); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { return recv_responseandstreamboththrows(returnState); }); } folly::SemiFuture> apache::thrift::Client<::cpp2::PubSubStreamingService>::semifuture_responseandstreamboththrows(::std::int32_t p_foo) { ::apache::thrift::RpcOptions rpcOptions; return semifuture_responseandstreamboththrows(rpcOptions, p_foo); } folly::SemiFuture> apache::thrift::Client<::cpp2::PubSubStreamingService>::semifuture_responseandstreamboththrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_responseandstreamboththrows, channel_); auto callback = std::move(callbackAndFuture.first); responseandstreamboththrows(rpcOptions, std::move(callback), p_foo); return std::move(callbackAndFuture.second); } folly::SemiFuture, std::unique_ptr>> apache::thrift::Client<::cpp2::PubSubStreamingService>::header_semifuture_responseandstreamboththrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_responseandstreamboththrows, channel_); auto callback = std::move(callbackAndFuture.first); responseandstreamboththrows(rpcOptions, std::move(callback), p_foo); return std::move(callbackAndFuture.second); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_wrapped_responseandstreamboththrows(apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t>& _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::PubSubStreamingService_responseandstreamboththrows_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_responseandstreamboththrows(::apache::thrift::ClientReceiveState& state) { apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> _return; auto ew = recv_wrapped_responseandstreamboththrows(_return, state); if (ew) { ew.throw_exception(); } return _return; } apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_instance_responseandstreamboththrows(::apache::thrift::ClientReceiveState& state) { return recv_responseandstreamboththrows(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_instance_wrapped_responseandstreamboththrows(apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t>& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_responseandstreamboththrows(_return, state); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::returnstreamFast(std::unique_ptr callback, ::std::int32_t p_i32_from, ::std::int32_t p_i32_to) { ::apache::thrift::RpcOptions rpcOptions; returnstreamFast(rpcOptions, std::move(callback), p_i32_from, p_i32_to); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::returnstreamFast(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, ::std::int32_t p_i32_from, ::std::int32_t p_i32_to) { auto [ctx, header] = returnstreamFastCtx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::createStreamClientCallback( apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)), rpcOptions.getBufferOptions()); returnstreamFastImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback), p_i32_from, p_i32_to); } void apache::thrift::Client<::cpp2::PubSubStreamingService>::returnstreamFastImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_i32_from, ::std::int32_t p_i32_to, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { returnstreamFastT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_i32_from, p_i32_to); } else { returnstreamFastT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_i32_from, p_i32_to); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { returnstreamFastT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_i32_from, p_i32_to); } else { returnstreamFastT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_i32_from, p_i32_to); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::cpp2::PubSubStreamingService>::returnstreamFastCtx(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_, getServiceName(), "PubSubStreamingService.returnstreamFast", *header); return {std::move(ctx), std::move(header)}; } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::sync_returnstreamFast(::std::int32_t p_i32_from, ::std::int32_t p_i32_to) { ::apache::thrift::RpcOptions rpcOptions; return sync_returnstreamFast(rpcOptions, p_i32_from, p_i32_to); } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::sync_returnstreamFast(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_i32_from, ::std::int32_t p_i32_to) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = returnstreamFastCtx(&rpcOptions); auto wrappedCallback = apache::thrift::createStreamClientCallback( apache::thrift::RequestClientCallback::Ptr(&callback), rpcOptions.getBufferOptions()); callback.waitUntilDone( evb, [&] { returnstreamFastImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback), p_i32_from, p_i32_to); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { return recv_returnstreamFast(returnState); }); } folly::SemiFuture> apache::thrift::Client<::cpp2::PubSubStreamingService>::semifuture_returnstreamFast(::std::int32_t p_i32_from, ::std::int32_t p_i32_to) { ::apache::thrift::RpcOptions rpcOptions; return semifuture_returnstreamFast(rpcOptions, p_i32_from, p_i32_to); } folly::SemiFuture> apache::thrift::Client<::cpp2::PubSubStreamingService>::semifuture_returnstreamFast(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_i32_from, ::std::int32_t p_i32_to) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_returnstreamFast, channel_); auto callback = std::move(callbackAndFuture.first); returnstreamFast(rpcOptions, std::move(callback), p_i32_from, p_i32_to); return std::move(callbackAndFuture.second); } folly::SemiFuture, std::unique_ptr>> apache::thrift::Client<::cpp2::PubSubStreamingService>::header_semifuture_returnstreamFast(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_i32_from, ::std::int32_t p_i32_to) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_returnstreamFast, channel_); auto callback = std::move(callbackAndFuture.first); returnstreamFast(rpcOptions, std::move(callback), p_i32_from, p_i32_to); return std::move(callbackAndFuture.second); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_wrapped_returnstreamFast(apache::thrift::ClientBufferedStream<::std::int32_t>& _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::PubSubStreamingService_returnstreamFast_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_returnstreamFast(::apache::thrift::ClientReceiveState& state) { apache::thrift::ClientBufferedStream<::std::int32_t> _return; auto ew = recv_wrapped_returnstreamFast(_return, state); if (ew) { ew.throw_exception(); } return _return; } apache::thrift::ClientBufferedStream<::std::int32_t> apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_instance_returnstreamFast(::apache::thrift::ClientReceiveState& state) { return recv_returnstreamFast(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::PubSubStreamingService>::recv_instance_wrapped_returnstreamFast(apache::thrift::ClientBufferedStream<::std::int32_t>& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_returnstreamFast(_return, state); }