wangzhibo
2026-07-16 bac4362a0b7726d38a23d38f0d7913f2c2bab262
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { CoolEvent, Event } from '@cool-midway/core';
import { EVENT_PLUGIN_READY } from '../../plugin/service/center';
 
/**
 * 普通事件
 */
@CoolEvent()
export class DemoCommEvent {
  /**
   * 根据事件名接收事件
   * @param msg
   * @param a
   */
  @Event('demo')
  async demo(msg, a) {
    console.log(`comm当前进程的ID是: ${process.pid}`);
    console.log('comm收到消息', msg, a);
  }
 
  /**
   * 插件已就绪
   */
  @Event(EVENT_PLUGIN_READY)
  async pluginReady() {
    // TODO 插件已就绪
  }
}