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

Method run

example/E03-ThirdFlow.cpp:38–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36class InputGNode : public GNode {
37public:
38 CStatus run() override {
39 for (int i = 0; i < 30; i++) {
40 std::shared_ptr<InputMParam> input(new InputMParam());
41 randomSleep(1, 5); // 间隔1~6ms,发送一次
42 input->num_ = std::abs((int)std::random_device{}()) % 5 + 1;
43 CGRAPH_SEND_MPARAM(InputMParam, INPUT_TOPIC_NAME, input, GMessagePushStrategy::WAIT);
44 }
45
46 CGRAPH_ECHO(" ----> InputGNode run finished");
47 return CStatus();
48 }
49};
50
51class ProcessGNode : public GNode {

Callers

nothing calls this directly

Calls 2

randomSleepFunction · 0.85
CGRAPH_ECHOFunction · 0.85

Tested by

no test coverage detected