| 15 | class MyPubMessageNode : public CGraph::GNode { |
| 16 | public: |
| 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()); // 创建一个消息,并且发送出去 |
nothing calls this directly
no test coverage detected