| 99 | }; |
| 100 | |
| 101 | void example_third_flow() { |
| 102 | CGRAPH_CREATE_MESSAGE_TOPIC(InputMParam, INPUT_TOPIC_NAME, 16); |
| 103 | CGRAPH_CREATE_MESSAGE_TOPIC(ResultMParam, RESULT_TOPIC_NAME, 16); |
| 104 | |
| 105 | auto pipeline = GPipelineFactory::create(); |
| 106 | GElementPtr input, process, result = nullptr; |
| 107 | pipeline->registerGElement<InputGNode>(&input); |
| 108 | pipeline->registerGElement<ProcessGNode>(&process); |
| 109 | pipeline->registerGElement<ResultGNode>(&result); |
| 110 | |
| 111 | UThreadPoolConfig config; |
| 112 | config.default_thread_size_ = 3; |
| 113 | config.secondary_thread_size_ = 0; |
| 114 | pipeline->setUniqueThreadPoolConfig(config); // 设置3个线程执行 |
| 115 | |
| 116 | pipeline->process(); |
| 117 | CGRAPH_CLEAR_MESSAGES() |
| 118 | GPipelineFactory::clear(); |
| 119 | } |
| 120 | |
| 121 | int main() { |
| 122 | example_third_flow(); |
no test coverage detected