feat: implement next-gen vectorized engine, async architecture, and modernization roadmap v2.32.0
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
/**
|
||||
* AgentEvents: 시스템 전체의 이벤트를 관리하는 관찰자(Observer) 허브.
|
||||
* 모듈 간 결합도를 낮추기 위해 직접 호출 대신 이벤트를 발행-구독합니다.
|
||||
*/
|
||||
export class AgentEvents extends EventEmitter {
|
||||
private static instance: AgentEvents;
|
||||
|
||||
private constructor() {
|
||||
super();
|
||||
this.setMaxListeners(20);
|
||||
}
|
||||
|
||||
public static getInstance(): AgentEvents {
|
||||
if (!AgentEvents.instance) {
|
||||
AgentEvents.instance = new AgentEvents();
|
||||
}
|
||||
return AgentEvents.instance;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 표준 이벤트 타입 정의
|
||||
*/
|
||||
export enum AgentEventTypes {
|
||||
DATA_READY = 'data:ready',
|
||||
TASK_STARTED = 'task:started',
|
||||
TASK_COMPLETED = 'task:completed',
|
||||
ERROR_OCCURRED = 'error:occurred',
|
||||
TRANSACTION_COMMITTED = 'transaction:committed',
|
||||
TRANSACTION_ROLLED_BACK = 'transaction:rolled_back'
|
||||
}
|
||||
|
||||
export const agentEvents = AgentEvents.getInstance();
|
||||
Reference in New Issue
Block a user