| 14 | class MyEventNode : public CGraph::GNode { |
| 15 | public: |
| 16 | CStatus run () override { |
| 17 | CStatus status; |
| 18 | CGraph::CGRAPH_ECHO("[%s], before event notify", this->getName().c_str()); |
| 19 | /** |
| 20 | * 模拟在这里,触发一个 trigger信息,同名的事件被异步执行 |
| 21 | * 从打印结果可以看出,after event send 这条信息,提前执行 |
| 22 | * 执行的时候,和pipeline公用同一个线程池资源 |
| 23 | */ |
| 24 | notify("my-print-event", GEventType::SYNC); |
| 25 | |
| 26 | CGraph::CGRAPH_ECHO("[%s], after event notify", this->getName().c_str()); |
| 27 | return status; |
| 28 | } |
| 29 | }; |
| 30 | |
| 31 | #endif //CGRAPH_MYEVENTNODE_H |
nothing calls this directly
no test coverage detected