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

Method init

tutorial/MyGNode/MyPubMessageNode.h:17–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15class MyPubMessageNode : public CGraph::GNode {
16public:
17 CStatus init() override {
18 int sleep = 300;
19 CGRAPH_SLEEP_MILLISECOND(sleep) // 休息,确保其他的sub节点,已经完成了订阅
20 CGraph::CGRAPH_ECHO("==> [MyPubMessageNode] [init], sleep [%d] ms, to make sure sub node prepare ok.",
21 sleep);
22 return CStatus();
23 }
24
25 CStatus run() override {
26 std::shared_ptr<MyMessageParam> mp(new MyMessageParam()); // 创建一个消息,并且发送出去

Callers

nothing calls this directly

Calls 1

CGRAPH_ECHOFunction · 0.85

Tested by

no test coverage detected