text: /**
   * Autogenerated by Thrift for src/module.thrift
   *
   * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
   *  @generated
   */
  
  #include "thrift/compiler/test/fixtures/stream/gen-cpp2/PubSubStreamingServiceAsyncClient.h"
  
  #include <thrift/lib/cpp2/gen/client_cpp.h>
  
  namespace cpp2 {
  typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::integral, ::std::int32_t*>, apache::thrift::FieldData<2, ::apache::thrift::type_class::integral, ::std::int32_t*>> PubSubStreamingService_returnstream_pargs;
  typedef apache::thrift::ThriftPResultStream<
      apache::thrift::ThriftPresult<true>, 
      apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>>
      > PubSubStreamingService_returnstream_presult;
  typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::integral, ::std::int32_t*>> PubSubStreamingService_streamthrows_pargs;
  typedef apache::thrift::ThriftPResultStream<
      apache::thrift::ThriftPresult<true>, 
      apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::cpp2::FooEx>>
      > PubSubStreamingService_streamthrows_presult;
  typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::integral, ::std::int32_t*>> PubSubStreamingService_boththrows_pargs;
  typedef apache::thrift::ThriftPResultStream<
      apache::thrift::ThriftPresult<true, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::cpp2::FooEx>>, 
      apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::cpp2::FooEx>>
      > PubSubStreamingService_boththrows_presult;
  typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::integral, ::std::int32_t*>> PubSubStreamingService_responseandstreamthrows_pargs;
  typedef apache::thrift::ThriftPResultStream<
      apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::cpp2::FooEx>>, 
      apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::cpp2::FooEx>>
      > PubSubStreamingService_responseandstreamthrows_presult;
  typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::integral, ::std::int32_t*>, apache::thrift::FieldData<2, ::apache::thrift::type_class::integral, ::std::int32_t*>> PubSubStreamingService_returnstreamFast_pargs;
  typedef apache::thrift::ThriftPResultStream<
      apache::thrift::ThriftPresult<true>, 
      apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>>
      > PubSubStreamingService_returnstreamFast_presult;
  
  template <typename Protocol_>
  void PubSubStreamingServiceAsyncClient::returnstreamT(Protocol_* prot, const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_i32_from, ::std::int32_t p_i32_to) {
  
    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);
    apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_STREAMING_RESPONSE, Protocol_>(prot, rpcOptions, std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
  
  }
  
  template <typename Protocol_>
  void PubSubStreamingServiceAsyncClient::streamthrowsT(Protocol_* prot, const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo) {
  
    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);
    apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_STREAMING_RESPONSE, Protocol_>(prot, rpcOptions, std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
  
  }
  
  template <typename Protocol_>
  void PubSubStreamingServiceAsyncClient::boththrowsT(Protocol_* prot, const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo) {
  
    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);
    apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_STREAMING_RESPONSE, Protocol_>(prot, rpcOptions, std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
  
  }
  
  template <typename Protocol_>
  void PubSubStreamingServiceAsyncClient::responseandstreamthrowsT(Protocol_* prot, const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo) {
  
    PubSubStreamingService_responseandstreamthrows_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(
                  "responseandstreamthrows",
                  ::apache::thrift::FunctionQualifier::Unspecified);
    apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_STREAMING_RESPONSE, Protocol_>(prot, rpcOptions, std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
  
  }
  
  template <typename Protocol_>
  void PubSubStreamingServiceAsyncClient::returnstreamFastT(Protocol_* prot, const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_i32_from, ::std::int32_t p_i32_to) {
  
    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);
    apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_STREAMING_RESPONSE, Protocol_>(prot, rpcOptions, std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
  
  }
  
  
  
  void PubSubStreamingServiceAsyncClient::returnstream(std::unique_ptr<apache::thrift::RequestCallback> 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 PubSubStreamingServiceAsyncClient::returnstream(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> 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 PubSubStreamingServiceAsyncClient::returnstreamImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_i32_from, ::std::int32_t p_i32_to) {
    switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
      case apache::thrift::protocol::T_BINARY_PROTOCOL:
      {
        apache::thrift::BinaryProtocolWriter writer;
        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;
        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<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> PubSubStreamingServiceAsyncClient::returnstreamCtx(apache::thrift::RpcOptions* rpcOptions) {
    auto header = std::make_shared<apache::thrift::transport::THeader>(
        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> PubSubStreamingServiceAsyncClient::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> PubSubStreamingServiceAsyncClient::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<false> callback(&returnState);
    auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
    auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
    auto [ctx, header] = returnstreamCtx(&rpcOptions);
    auto wrappedCallback = apache::thrift::createStreamClientCallback(
      apache::thrift::RequestClientCallback::Ptr(&callback),
      rpcOptions.getBufferOptions());
    returnstreamImpl(rpcOptions, std::move(header), ctx.get(), std::move(wrappedCallback), p_i32_from, p_i32_to);
    callback.waitUntilDone(evb);
  
    if (returnState.isException()) {
      returnState.exception().throw_exception();
    }
    returnState.resetProtocolId(protocolId);
    returnState.resetCtx(std::move(ctx));
    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::ClientBufferedStream<::std::int32_t>> PubSubStreamingServiceAsyncClient::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::ClientBufferedStream<::std::int32_t>> PubSubStreamingServiceAsyncClient::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::pair<apache::thrift::ClientBufferedStream<::std::int32_t>, std::unique_ptr<apache::thrift::transport::THeader>>> PubSubStreamingServiceAsyncClient::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 PubSubStreamingServiceAsyncClient::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<apache::thrift::TApplicationException>("recv_ called without result");
    }
  
    using result = PubSubStreamingService_returnstream_presult;
    switch (state.protocolId()) {
      case apache::thrift::protocol::T_BINARY_PROTOCOL:
      {
        apache::thrift::BinaryProtocolReader reader;
        return apache::thrift::detail::ac::recv_wrapped<result>(
            &reader, state, _return);
      }
      case apache::thrift::protocol::T_COMPACT_PROTOCOL:
      {
        apache::thrift::CompactProtocolReader reader;
        return apache::thrift::detail::ac::recv_wrapped<result>(
            &reader, state, _return);
      }
      default:
      {
      }
    }
    return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
  }
  
  apache::thrift::ClientBufferedStream<::std::int32_t> PubSubStreamingServiceAsyncClient::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> PubSubStreamingServiceAsyncClient::recv_instance_returnstream(::apache::thrift::ClientReceiveState& state) {
    return recv_returnstream(state);
  }
  
  folly::exception_wrapper PubSubStreamingServiceAsyncClient::recv_instance_wrapped_returnstream(apache::thrift::ClientBufferedStream<::std::int32_t>& _return, ::apache::thrift::ClientReceiveState& state) {
    return recv_wrapped_returnstream(_return, state);
  }
  
  void PubSubStreamingServiceAsyncClient::streamthrows(std::unique_ptr<apache::thrift::RequestCallback> callback, ::std::int32_t p_foo) {
    ::apache::thrift::RpcOptions rpcOptions;
    streamthrows(rpcOptions, std::move(callback), p_foo);
  }
  
  void PubSubStreamingServiceAsyncClient::streamthrows(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> 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 PubSubStreamingServiceAsyncClient::streamthrowsImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo) {
    switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
      case apache::thrift::protocol::T_BINARY_PROTOCOL:
      {
        apache::thrift::BinaryProtocolWriter writer;
        streamthrowsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_foo);
        break;
      }
      case apache::thrift::protocol::T_COMPACT_PROTOCOL:
      {
        apache::thrift::CompactProtocolWriter writer;
        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<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> PubSubStreamingServiceAsyncClient::streamthrowsCtx(apache::thrift::RpcOptions* rpcOptions) {
    auto header = std::make_shared<apache::thrift::transport::THeader>(
        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> PubSubStreamingServiceAsyncClient::sync_streamthrows(::std::int32_t p_foo) {
    ::apache::thrift::RpcOptions rpcOptions;
    return sync_streamthrows(rpcOptions, p_foo);
  }
  
  apache::thrift::ClientBufferedStream<::std::int32_t> PubSubStreamingServiceAsyncClient::sync_streamthrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) {
    apache::thrift::ClientReceiveState returnState;
    apache::thrift::ClientSyncCallback<false> callback(&returnState);
    auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
    auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
    auto [ctx, header] = streamthrowsCtx(&rpcOptions);
    auto wrappedCallback = apache::thrift::createStreamClientCallback(
      apache::thrift::RequestClientCallback::Ptr(&callback),
      rpcOptions.getBufferOptions());
    streamthrowsImpl(rpcOptions, std::move(header), ctx.get(), std::move(wrappedCallback), p_foo);
    callback.waitUntilDone(evb);
  
    if (returnState.isException()) {
      returnState.exception().throw_exception();
    }
    returnState.resetProtocolId(protocolId);
    returnState.resetCtx(std::move(ctx));
    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::ClientBufferedStream<::std::int32_t>> PubSubStreamingServiceAsyncClient::semifuture_streamthrows(::std::int32_t p_foo) {
    ::apache::thrift::RpcOptions rpcOptions;
    return semifuture_streamthrows(rpcOptions, p_foo);
  }
  
  
  folly::SemiFuture<apache::thrift::ClientBufferedStream<::std::int32_t>> PubSubStreamingServiceAsyncClient::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::pair<apache::thrift::ClientBufferedStream<::std::int32_t>, std::unique_ptr<apache::thrift::transport::THeader>>> PubSubStreamingServiceAsyncClient::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 PubSubStreamingServiceAsyncClient::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<apache::thrift::TApplicationException>("recv_ called without result");
    }
  
    using result = PubSubStreamingService_streamthrows_presult;
    switch (state.protocolId()) {
      case apache::thrift::protocol::T_BINARY_PROTOCOL:
      {
        apache::thrift::BinaryProtocolReader reader;
        return apache::thrift::detail::ac::recv_wrapped<result>(
            &reader, state, _return);
      }
      case apache::thrift::protocol::T_COMPACT_PROTOCOL:
      {
        apache::thrift::CompactProtocolReader reader;
        return apache::thrift::detail::ac::recv_wrapped<result>(
            &reader, state, _return);
      }
      default:
      {
      }
    }
    return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
  }
  
  apache::thrift::ClientBufferedStream<::std::int32_t> PubSubStreamingServiceAsyncClient::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> PubSubStreamingServiceAsyncClient::recv_instance_streamthrows(::apache::thrift::ClientReceiveState& state) {
    return recv_streamthrows(state);
  }
  
  folly::exception_wrapper PubSubStreamingServiceAsyncClient::recv_instance_wrapped_streamthrows(apache::thrift::ClientBufferedStream<::std::int32_t>& _return, ::apache::thrift::ClientReceiveState& state) {
    return recv_wrapped_streamthrows(_return, state);
  }
  
  void PubSubStreamingServiceAsyncClient::boththrows(std::unique_ptr<apache::thrift::RequestCallback> callback, ::std::int32_t p_foo) {
    ::apache::thrift::RpcOptions rpcOptions;
    boththrows(rpcOptions, std::move(callback), p_foo);
  }
  
  void PubSubStreamingServiceAsyncClient::boththrows(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> 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 PubSubStreamingServiceAsyncClient::boththrowsImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo) {
    switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
      case apache::thrift::protocol::T_BINARY_PROTOCOL:
      {
        apache::thrift::BinaryProtocolWriter writer;
        boththrowsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_foo);
        break;
      }
      case apache::thrift::protocol::T_COMPACT_PROTOCOL:
      {
        apache::thrift::CompactProtocolWriter writer;
        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<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> PubSubStreamingServiceAsyncClient::boththrowsCtx(apache::thrift::RpcOptions* rpcOptions) {
    auto header = std::make_shared<apache::thrift::transport::THeader>(
        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> PubSubStreamingServiceAsyncClient::sync_boththrows(::std::int32_t p_foo) {
    ::apache::thrift::RpcOptions rpcOptions;
    return sync_boththrows(rpcOptions, p_foo);
  }
  
  apache::thrift::ClientBufferedStream<::std::int32_t> PubSubStreamingServiceAsyncClient::sync_boththrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) {
    apache::thrift::ClientReceiveState returnState;
    apache::thrift::ClientSyncCallback<false> callback(&returnState);
    auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
    auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
    auto [ctx, header] = boththrowsCtx(&rpcOptions);
    auto wrappedCallback = apache::thrift::createStreamClientCallback(
      apache::thrift::RequestClientCallback::Ptr(&callback),
      rpcOptions.getBufferOptions());
    boththrowsImpl(rpcOptions, std::move(header), ctx.get(), std::move(wrappedCallback), p_foo);
    callback.waitUntilDone(evb);
  
    if (returnState.isException()) {
      returnState.exception().throw_exception();
    }
    returnState.resetProtocolId(protocolId);
    returnState.resetCtx(std::move(ctx));
    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::ClientBufferedStream<::std::int32_t>> PubSubStreamingServiceAsyncClient::semifuture_boththrows(::std::int32_t p_foo) {
    ::apache::thrift::RpcOptions rpcOptions;
    return semifuture_boththrows(rpcOptions, p_foo);
  }
  
  
  folly::SemiFuture<apache::thrift::ClientBufferedStream<::std::int32_t>> PubSubStreamingServiceAsyncClient::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::pair<apache::thrift::ClientBufferedStream<::std::int32_t>, std::unique_ptr<apache::thrift::transport::THeader>>> PubSubStreamingServiceAsyncClient::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 PubSubStreamingServiceAsyncClient::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<apache::thrift::TApplicationException>("recv_ called without result");
    }
  
    using result = PubSubStreamingService_boththrows_presult;
    switch (state.protocolId()) {
      case apache::thrift::protocol::T_BINARY_PROTOCOL:
      {
        apache::thrift::BinaryProtocolReader reader;
        return apache::thrift::detail::ac::recv_wrapped<result>(
            &reader, state, _return);
      }
      case apache::thrift::protocol::T_COMPACT_PROTOCOL:
      {
        apache::thrift::CompactProtocolReader reader;
        return apache::thrift::detail::ac::recv_wrapped<result>(
            &reader, state, _return);
      }
      default:
      {
      }
    }
    return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
  }
  
  apache::thrift::ClientBufferedStream<::std::int32_t> PubSubStreamingServiceAsyncClient::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> PubSubStreamingServiceAsyncClient::recv_instance_boththrows(::apache::thrift::ClientReceiveState& state) {
    return recv_boththrows(state);
  }
  
  folly::exception_wrapper PubSubStreamingServiceAsyncClient::recv_instance_wrapped_boththrows(apache::thrift::ClientBufferedStream<::std::int32_t>& _return, ::apache::thrift::ClientReceiveState& state) {
    return recv_wrapped_boththrows(_return, state);
  }
  
  void PubSubStreamingServiceAsyncClient::responseandstreamthrows(std::unique_ptr<apache::thrift::RequestCallback> callback, ::std::int32_t p_foo) {
    ::apache::thrift::RpcOptions rpcOptions;
    responseandstreamthrows(rpcOptions, std::move(callback), p_foo);
  }
  
  void PubSubStreamingServiceAsyncClient::responseandstreamthrows(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback, ::std::int32_t p_foo) {
    auto [ctx, header] = responseandstreamthrowsCtx(&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());
    responseandstreamthrowsImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback), p_foo);
  }
  
  void PubSubStreamingServiceAsyncClient::responseandstreamthrowsImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_foo) {
    switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
      case apache::thrift::protocol::T_BINARY_PROTOCOL:
      {
        apache::thrift::BinaryProtocolWriter writer;
        responseandstreamthrowsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_foo);
        break;
      }
      case apache::thrift::protocol::T_COMPACT_PROTOCOL:
      {
        apache::thrift::CompactProtocolWriter writer;
        responseandstreamthrowsT(&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<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> PubSubStreamingServiceAsyncClient::responseandstreamthrowsCtx(apache::thrift::RpcOptions* rpcOptions) {
    auto header = std::make_shared<apache::thrift::transport::THeader>(
        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.responseandstreamthrows",
        *header);
  
    return {std::move(ctx), std::move(header)};
  }
  
  apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> PubSubStreamingServiceAsyncClient::sync_responseandstreamthrows(::std::int32_t p_foo) {
    ::apache::thrift::RpcOptions rpcOptions;
    return sync_responseandstreamthrows(rpcOptions, p_foo);
  }
  
  apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> PubSubStreamingServiceAsyncClient::sync_responseandstreamthrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) {
    apache::thrift::ClientReceiveState returnState;
    apache::thrift::ClientSyncCallback<false> callback(&returnState);
    auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
    auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
    auto [ctx, header] = responseandstreamthrowsCtx(&rpcOptions);
    auto wrappedCallback = apache::thrift::createStreamClientCallback(
      apache::thrift::RequestClientCallback::Ptr(&callback),
      rpcOptions.getBufferOptions());
    responseandstreamthrowsImpl(rpcOptions, std::move(header), ctx.get(), std::move(wrappedCallback), p_foo);
    callback.waitUntilDone(evb);
  
    if (returnState.isException()) {
      returnState.exception().throw_exception();
    }
    returnState.resetProtocolId(protocolId);
    returnState.resetCtx(std::move(ctx));
    SCOPE_EXIT {
      if (returnState.header() && !returnState.header()->getHeaders().empty()) {
        rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
      }
    };
    return folly::fibers::runInMainContext([&] {
        return recv_responseandstreamthrows(returnState);
    });
  }
  
  
  
  folly::SemiFuture<apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t>> PubSubStreamingServiceAsyncClient::semifuture_responseandstreamthrows(::std::int32_t p_foo) {
    ::apache::thrift::RpcOptions rpcOptions;
    return semifuture_responseandstreamthrows(rpcOptions, p_foo);
  }
  
  
  folly::SemiFuture<apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t>> PubSubStreamingServiceAsyncClient::semifuture_responseandstreamthrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) {
    auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_responseandstreamthrows, channel_);
    auto callback = std::move(callbackAndFuture.first);
    responseandstreamthrows(rpcOptions, std::move(callback), p_foo);
    return std::move(callbackAndFuture.second);
  }
  
  
  folly::SemiFuture<std::pair<apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t>, std::unique_ptr<apache::thrift::transport::THeader>>> PubSubStreamingServiceAsyncClient::header_semifuture_responseandstreamthrows(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_foo) {
    auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_responseandstreamthrows, channel_);
    auto callback = std::move(callbackAndFuture.first);
    responseandstreamthrows(rpcOptions, std::move(callback), p_foo);
    return std::move(callbackAndFuture.second);
  }
  
  
  #if FOLLY_HAS_COROUTINES
  #endif // FOLLY_HAS_COROUTINES
  folly::exception_wrapper PubSubStreamingServiceAsyncClient::recv_wrapped_responseandstreamthrows(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<apache::thrift::TApplicationException>("recv_ called without result");
    }
  
    using result = PubSubStreamingService_responseandstreamthrows_presult;
    switch (state.protocolId()) {
      case apache::thrift::protocol::T_BINARY_PROTOCOL:
      {
        apache::thrift::BinaryProtocolReader reader;
        return apache::thrift::detail::ac::recv_wrapped<result>(
            &reader, state, _return);
      }
      case apache::thrift::protocol::T_COMPACT_PROTOCOL:
      {
        apache::thrift::CompactProtocolReader reader;
        return apache::thrift::detail::ac::recv_wrapped<result>(
            &reader, state, _return);
      }
      default:
      {
      }
    }
    return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
  }
  
  apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> PubSubStreamingServiceAsyncClient::recv_responseandstreamthrows(::apache::thrift::ClientReceiveState& state) {
    apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> _return;
    auto ew = recv_wrapped_responseandstreamthrows(_return, state);
    if (ew) {
      ew.throw_exception();
    }
    return _return;
  }
  
  apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t> PubSubStreamingServiceAsyncClient::recv_instance_responseandstreamthrows(::apache::thrift::ClientReceiveState& state) {
    return recv_responseandstreamthrows(state);
  }
  
  folly::exception_wrapper PubSubStreamingServiceAsyncClient::recv_instance_wrapped_responseandstreamthrows(apache::thrift::ResponseAndClientBufferedStream<::std::int32_t,::std::int32_t>& _return, ::apache::thrift::ClientReceiveState& state) {
    return recv_wrapped_responseandstreamthrows(_return, state);
  }
  
  void PubSubStreamingServiceAsyncClient::returnstreamFast(std::unique_ptr<apache::thrift::RequestCallback> 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 PubSubStreamingServiceAsyncClient::returnstreamFast(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> 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 PubSubStreamingServiceAsyncClient::returnstreamFastImpl(const apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, ::std::int32_t p_i32_from, ::std::int32_t p_i32_to) {
    switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
      case apache::thrift::protocol::T_BINARY_PROTOCOL:
      {
        apache::thrift::BinaryProtocolWriter writer;
        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;
        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<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> PubSubStreamingServiceAsyncClient::returnstreamFastCtx(apache::thrift::RpcOptions* rpcOptions) {
    auto header = std::make_shared<apache::thrift::transport::THeader>(
        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> PubSubStreamingServiceAsyncClient::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> PubSubStreamingServiceAsyncClient::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<false> callback(&returnState);
    auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
    auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
    auto [ctx, header] = returnstreamFastCtx(&rpcOptions);
    auto wrappedCallback = apache::thrift::createStreamClientCallback(
      apache::thrift::RequestClientCallback::Ptr(&callback),
      rpcOptions.getBufferOptions());
    returnstreamFastImpl(rpcOptions, std::move(header), ctx.get(), std::move(wrappedCallback), p_i32_from, p_i32_to);
    callback.waitUntilDone(evb);
  
    if (returnState.isException()) {
      returnState.exception().throw_exception();
    }
    returnState.resetProtocolId(protocolId);
    returnState.resetCtx(std::move(ctx));
    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::ClientBufferedStream<::std::int32_t>> PubSubStreamingServiceAsyncClient::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::ClientBufferedStream<::std::int32_t>> PubSubStreamingServiceAsyncClient::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::pair<apache::thrift::ClientBufferedStream<::std::int32_t>, std::unique_ptr<apache::thrift::transport::THeader>>> PubSubStreamingServiceAsyncClient::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 PubSubStreamingServiceAsyncClient::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<apache::thrift::TApplicationException>("recv_ called without result");
    }
  
    using result = PubSubStreamingService_returnstreamFast_presult;
    switch (state.protocolId()) {
      case apache::thrift::protocol::T_BINARY_PROTOCOL:
      {
        apache::thrift::BinaryProtocolReader reader;
        return apache::thrift::detail::ac::recv_wrapped<result>(
            &reader, state, _return);
      }
      case apache::thrift::protocol::T_COMPACT_PROTOCOL:
      {
        apache::thrift::CompactProtocolReader reader;
        return apache::thrift::detail::ac::recv_wrapped<result>(
            &reader, state, _return);
      }
      default:
      {
      }
    }
    return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
  }
  
  apache::thrift::ClientBufferedStream<::std::int32_t> PubSubStreamingServiceAsyncClient::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> PubSubStreamingServiceAsyncClient::recv_instance_returnstreamFast(::apache::thrift::ClientReceiveState& state) {
    return recv_returnstreamFast(state);
  }
  
  folly::exception_wrapper PubSubStreamingServiceAsyncClient::recv_instance_wrapped_returnstreamFast(apache::thrift::ClientBufferedStream<::std::int32_t>& _return, ::apache::thrift::ClientReceiveState& state) {
    return recv_wrapped_returnstreamFast(_return, state);
  }
  
  
  } // cpp2
  