thrift/lib/cpp2/test/AsyncProcessorTest.cpp
// Setup monitoring interface handler for test below
Setup monitoring interface handler for test below
Setup monitoring interface handler for test below
THRIFT_PLUGGABLE_FUNC_SET(
    std::unique_ptr<rocket::SetupFrameHandler>,
    createRocketMonitoringSetupFrameHandler,
    ThriftServer& server) {
  class MonitoringConnectionHandler : public rocket::SetupFrameHandler {
   public:
    explicit MonitoringConnectionHandler(ThriftServer& server)
        : server_(server) {}
    std::optional<rocket::ProcessorInfo> tryHandle(
        const RequestSetupMetadata& meta) override {
      if (meta.interfaceKind_ref() == InterfaceKind::MONITORING) {
        auto processorFactory = server_.getMonitoringProcessorFactory();
        DCHECK(processorFactory);
        return rocket::ProcessorInfo{
            *processorFactory,
            std::make_shared<concurrency::ThreadManagerExecutorAdapter>(
                folly::getGlobalCPUExecutor()),
            server_,
            nullptr 
        };
      }
      return std::nullopt;
    }
   private:
    ThriftServer& server_;
  };
  return std::make_unique<MonitoringConnectionHandler>(server);
}
THRIFT_PLUGGABLE_FUNC_SET ( std :: unique_ptr < rocket :: SetupFrameHandler > , createRocketMonitoringSetupFrameHandler , ThriftServer & server ) { class MonitoringConnectionHandler : public rocket :: SetupFrameHandler { public : explicit MonitoringConnectionHandler ( ThriftServer & server ) : server_ ( server ) { } std :: optional < rocket :: ProcessorInfo > tryHandle ( const RequestSetupMetadata & meta ) override { if ( meta . interfaceKind_ref ( ) == InterfaceKind :: MONITORING ) { auto processorFactory = server_ . getMonitoringProcessorFactory ( ) ; DCHECK ( processorFactory ) ; return rocket :: ProcessorInfo { * processorFactory , std :: make_shared < concurrency :: ThreadManagerExecutorAdapter > ( folly :: getGlobalCPUExecutor ( ) ) , server_ , nullptr } ; } return std :: nullopt ; } private : ThriftServer & server_ ; } ; return std :: make_unique < MonitoringConnectionHandler > ( server ) ; }
Setup monitoring interface handler for test below
Setup monitoring interface handler for test below
/* requestsRegistry */