mirror of
https://github.com/louislam/dockge.git
synced 2026-05-21 14:02:17 +00:00
Multiple Dockge instances (#200)
This commit is contained in:
15
common/agent-socket.ts
Normal file
15
common/agent-socket.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export class AgentSocket {
|
||||
|
||||
eventList : Map<string, (...args : unknown[]) => void> = new Map();
|
||||
|
||||
on(event : string, callback : (...args : unknown[]) => void) {
|
||||
this.eventList.set(event, callback);
|
||||
}
|
||||
|
||||
call(eventName : string, ...args : unknown[]) {
|
||||
const callback = this.eventList.get(eventName);
|
||||
if (callback) {
|
||||
callback(...args);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user