| 43 | |
| 44 | |
| 45 | CStatus GEvent::process(GEventType type, GEventAsyncStrategy strategy) { |
| 46 | CGRAPH_FUNCTION_BEGIN |
| 47 | |
| 48 | switch (type) { |
| 49 | case GEventType::SYNC: // 同步触发 |
| 50 | this->trigger(this->param_); |
| 51 | break; |
| 52 | case GEventType::ASYNC: // 异步触发 |
| 53 | CGRAPH_ASSERT_NOT_NULL(this->thread_pool_) |
| 54 | asyncProcess(strategy); |
| 55 | break; |
| 56 | default: |
| 57 | CGRAPH_RETURN_ERROR_STATUS("unknown event type") |
| 58 | } |
| 59 | |
| 60 | CGRAPH_FUNCTION_END |
| 61 | } |
| 62 | |
| 63 | |
| 64 | std::shared_future<CVoid> GEvent::asyncProcess(GEventAsyncStrategy strategy) { |
no outgoing calls