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

Function mock_client_request

example/E05-HttpServer.cpp:75–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73
74
75void mock_client_request(GPipelineManager& manager) {
76 for (int i = 0; i < 10; i++) {
77 /**
78 * 不同的线程,直接调用manger的run,是互斥运行的
79 * 相当于直接运行 manager中 的pipeline 中的run函数
80 * 如果并发请求数量,超过 manager中 pipeline数量,则status返回报错。
81 * 也可以通过 manager.fetch() 和 manager.release() 接口在外部控制pipeline的获取和释放
82 */
83 auto status = manager.run();
84 if (status.isErr()) {
85 CGRAPH_ECHO("manager run failed. err info is [%s]", status.getInfo().c_str());
86 }
87 CGRAPH_SLEEP_MILLISECOND(10);
88 }
89}
90
91
92void example_http_server() {

Callers 1

example_http_serverFunction · 0.85

Calls 3

CGRAPH_ECHOFunction · 0.85
isErrMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected