MCPcopy Create free account
hub / github.com/ChunelFeng/CGraph / example_http_server

Function example_http_server

example/E05-HttpServer.cpp:92–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90
91
92void example_http_server() {
93 GPipelineManager manager;
94 const int times = 3;
95 for (int i = 0; i < times; i++) {
96 auto pipeline = build_pipeline();
97 manager.add(pipeline); // 在manger中,加入3个pipeline信息
98 }
99 auto status = manager.init(); // 初始化 manager 中所有的pipeline信息
100
101 std::vector<std::thread> thds;
102 for (int i = 0; i < times; i++) {
103 auto thd = std::thread([&] {
104 mock_client_request(manager);
105 });
106 thds.emplace_back(std::move(thd));
107 }
108
109 for (int i = 0; i < times; i++) {
110 thds[i].join();
111 }
112
113 manager.destroy();
114 GPipelineFactory::clear(); // 这里析构所有的pipeline信息
115}
116
117
118int main() {

Callers 1

mainFunction · 0.85

Calls 6

build_pipelineFunction · 0.85
mock_client_requestFunction · 0.85
clearFunction · 0.50
addMethod · 0.45
initMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected