import { eventBus } from '../bus';
import { broadcast } from '../../ws/server';

/**
 * WebSocket Broadcaster Consumer
 * Listens to all events and forwards to connected WS clients
 */
export function startWSBroadcaster(): void {
  eventBus.on('*', (event) => {
    broadcast(event);
  });
  console.log('[Consumer:WS] Broadcaster started');
}
