chore: src/modules/demo/event/comm.ts

This commit is contained in:
2026-07-01 17:56:32 +08:00
parent 26932068af
commit 173cdea3c3
+27
View File
@@ -0,0 +1,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 插件已就绪
}
}