mirror of
https://github.com/khoaliber/dockhand.git
synced 2026-03-06 13:21:53 +00:00
Initial commit
This commit is contained in:
18
lib/server/event-collector.ts
Normal file
18
lib/server/event-collector.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Container Event Emitter
|
||||
*
|
||||
* Shared EventEmitter for broadcasting container events to SSE clients.
|
||||
* Events are emitted by the subprocess-manager when it receives them from the event-subprocess.
|
||||
*/
|
||||
|
||||
import { EventEmitter } from 'node:events';
|
||||
|
||||
// Event emitter for broadcasting new events to SSE clients
|
||||
// Used by:
|
||||
// - subprocess-manager.ts: emits events received from event-subprocess via IPC
|
||||
// - api/activity/events/+server.ts: listens for events to broadcast via SSE
|
||||
export const containerEventEmitter = new EventEmitter();
|
||||
|
||||
// Allow up to 100 concurrent SSE listeners (default is 10)
|
||||
// This prevents MaxListenersExceededWarning with many dashboard clients
|
||||
containerEventEmitter.setMaxListeners(100);
|
||||
Reference in New Issue
Block a user